English 中文(简体)
DTMF monitoring via multimon, awk and espeak
原标题:
  • 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.

3 years passed and still no advance in linux DTMF decoding.

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

问题回答

I believe that my answer is out of date and perhaps you have found how to solve this.

I faced the same issue and figured out that the problem is in multimon. When you pipe the stdout from multimon to another program, multimon does not flush the verbose output properly.

Try to patch and recompile multimon, adding a "fflush(stdout);", like this:

(unixinput.c , around line 71 )

    void verbprintf(int verb_level, const char *fmt, ...)
    {
            va_list args;

            va_start(args, fmt);
            if (verb_level <= verbose_level) {
                    vfprintf(stdout, fmt, args);



                    fflush(stdout); //ADD THIS LINE!!!!!!!!!!!!!!!



                    }
            va_end(args);
    }

Best regards,

-Eduardo

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

@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)
}
 




相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

热门标签