views:

172

answers:

2

Hello, the question is:

  • How to listen to the spoken DTMD digit every time the sound card capture one?

The objective is radio controlling my pc and interfaces activities dialing dtmf tones via a hand-held transceiver.

I used multimon to hear DTMF tones I tried to use awk to filter digits and proceed accordingly. For example, if I key "0" from the radio the system must reboot, etc, but first confirming the operation. " The computer will reboot, send # to confirm"...

I tried to use espeak for a voice confirmation to the remote radio. The radio connected to the pc soundcard receives the commands and transmits the responses.

I do not simply know how to nest multimon within awk within espeak.

Multimon itself doesnt let me do anything with its stdout because its running ( do not terminate after hearing a digit, which is indeed right).

It would be extremely helpful if I knew how to just speak each digit, without exiting the natural multimon loop.

Say, multimon -a DTMF | awk'{print}' espeak -stdin If this simply worked!

Is it possible to do? Any help wellcome. Once I didnt see any DTMF Radio Controlling project in Linux, I plan to publish this shall I can solve this issue.

Thanks / Mario/ sao paulo brazil

A: 

You can use the system() function to launch espeak from your awk script.

caf
Thanks, I will study this function. Do you have a simple example for a short minded me?
m33600
I'd like to comment that multimon outputs texts in the terminal. It decodes well the DTMF tones, I read the outputs ( DTMF 1, DTMF 2, etc) but cannot grab this output text! It renders useless.
m33600
A: 

@OP, i am not clear about your question, but seeing that system() interests you, here's how you call external command in awk

multimon -a DTMF | awk '{
  cmd="espeak "$0 #$0 comes from the multimon output
  system(cmd)
}
'
ghostdog74
Thanks a lot, I believe this is the magic word! Now I'm stuck with another problem: multimon itself refuses to instal on PCLINUXOS (manually or via synaptic - not in repos), so I had to get back to ubuntu to try your answer. Downloading now. I ll be back with the result.
m33600