linuxraspberry-pisoxdtmf

live detect DTMF code from the mic using sox and multimon-ng


I want to detect the DTMF tones from the live audio stream. I am able to record the live audio and store it to a wave file using sox:

sox -b 16 -e signed-integer -c 1 -d -t wavpcm tt.wav

I am also able to detect the tone using multimon-ng:

multimon-ng -t wav -a DTMF tt.wav 

but when I connect the two it didn't work:

sox -b 16 -e signed-integer -c 1 -d -t wavpcm - | multimon-ng -t wav -a DTMF -

Please help me in completing this flow - live record audio + detect DTMF tone + print the character code


Solution

  • I have not tried this, but this is what came to mind is to use a named pipe

    mkfifo ~/fifo
    
    sox -b 16 -e signed-integer -c 1 -d -t wavpcm ~/fifo &
    
    multimon-ng -t wav -a DTMF ~/fifo
    

    It looks like it has been solved in a similar way before:

    Stream audio from named pipe