ribt/dtmf-decoder

Use dtmf-decoder with the standard input instead of wav file ?

moving-digital opened this issue · 1 comments

Hello @ribt , @clemg , @OBITORASU , @rishitsaiya ,

First of all, thanks for this great project!

Is there a way to read to use the dtmf-decoder with the standard input, instead of an offline wav file ?

I tried to use a named pipe (fifo) to simulate the standard input stored into a wav file, but I'm getting the following errors.

If the wav file is open while trying to read it:

 "Impossible to read:"
 "Please give a wav file."

Or that one when using the named pipe:

Traceback (most recent call last):
  File "/usr/local/bin/dtmf", line 26, in <module>
    fps, data = wavfile.read(file)
  File "/usr/local/lib/python3.9/dist-packages/scipy/io/wavfile.py", line 553, in read
    while fid.tell() < file_size:
OSError: [Errno 29] Illegal seek

I know we cannot seek in a PIPE, but is there a way to use maybe BytesIO or StringIO?

Hey, did you find a solution to using stdin instead of a file?