How To remove audio pauses, handle stacked pages
I had an idea about how to use TwoToneDetect to do the decoding of fire pages, and then hook on my own post processing to extend the functionality. After some playing around, it is working fine.
Goals...
Handle Stacked Tones
Remove gaps in recorded the audio
Email to me and my cell phone
Trigger custom recordings, have flexible processing, etc
First I worked with TwoToneDetect to correctly decode all the tone pairs I wanted. Did not set up the email within that app, but did set up writing WAV files to the Audio File Directory. I set the record length to 0.1 seconds. All I wanted at that point was a filename as a trigger, and the contents were discarded. This way stacked pages cause one trigger each. I then set up the Command Line Executed to be my own batch file. I used this
c:\TwoTones\Trigger.bat "[p]"
Now the fun starts.
That needs a program from SysInternals called psexec. It's free from Microsoft (who bought the original company). What that allows is the triggering of a second (or third, etc) batch file that will run without becoming a child of the main batch process. Once that 2nd file is started, this batch file keeps running. In fact, it is so fast that it returns control back to TwoToneDetect almost instantly. That allows detecting the next pair of tones.
The called batch file TwoToneProcess2.bat does the main work. First it manipulated the trigger file to get directory and agency names. Then it triggers a free sound editor to record the audio stream. I used SOX to do that. When you install it, to get the recorder tool you copy sox.exe to rec.exe. It's in its docs.
Then using SOX again, I process the file to remove gaps, do some filtering, and normalize the level. Final process is to have an MP3 and an AMR file for cell phones.
Last is to email them to my email on yahoo, and to my cell phone as a multimedia message. Used BLAT to do that.
I am running on Win 7. My C drive is solid state, so all is running there. One thing that UAC blocked was writing audio files across sub-directories. So I made the permissions on c:\twotones (where this all runs) to be "everyone" full control for all files and sub-directories.
The trigger batch also refers to TwoToneProcessCall.bat. That is nearly identical to the TwoToneProcess2 file but has no email, the recording time is set to 60:00, and the filename portion is this:
SET FileAmrTemp1=%SentFileName:~0,-4%.amr-nb
SET FileAmr=%SentFileName:~0,-4%.amr
SET FileMp3Temp1=%SentFileName:~0,-4%-temp1.mp3
SET FileMp3Temp2=%SentFileName:~0,-4%-temp2.mp3
SET FileMp3Temp3=%SentFileName:~0,-4%-temp3.mp3
SET FileMp3Short=%SentFileName:~0,-4%.mp3
It is a work in progress, but it has been working fine for me. Nice thing is that it can be altered easily and made to do all sorts of tricks based upon which page is processed, where it is being sent, etc.
All the tools I used are free.
So shall this be free for all to enjoy.
BAT files attached as plain text. Rename them.
Andy
I had an idea about how to use TwoToneDetect to do the decoding of fire pages, and then hook on my own post processing to extend the functionality. After some playing around, it is working fine.
Goals...
Handle Stacked Tones
Remove gaps in recorded the audio
Email to me and my cell phone
Trigger custom recordings, have flexible processing, etc
First I worked with TwoToneDetect to correctly decode all the tone pairs I wanted. Did not set up the email within that app, but did set up writing WAV files to the Audio File Directory. I set the record length to 0.1 seconds. All I wanted at that point was a filename as a trigger, and the contents were discarded. This way stacked pages cause one trigger each. I then set up the Command Line Executed to be my own batch file. I used this
c:\TwoTones\Trigger.bat "[p]"
Now the fun starts.
That needs a program from SysInternals called psexec. It's free from Microsoft (who bought the original company). What that allows is the triggering of a second (or third, etc) batch file that will run without becoming a child of the main batch process. Once that 2nd file is started, this batch file keeps running. In fact, it is so fast that it returns control back to TwoToneDetect almost instantly. That allows detecting the next pair of tones.
The called batch file TwoToneProcess2.bat does the main work. First it manipulated the trigger file to get directory and agency names. Then it triggers a free sound editor to record the audio stream. I used SOX to do that. When you install it, to get the recorder tool you copy sox.exe to rec.exe. It's in its docs.
Then using SOX again, I process the file to remove gaps, do some filtering, and normalize the level. Final process is to have an MP3 and an AMR file for cell phones.
Last is to email them to my email on yahoo, and to my cell phone as a multimedia message. Used BLAT to do that.
I am running on Win 7. My C drive is solid state, so all is running there. One thing that UAC blocked was writing audio files across sub-directories. So I made the permissions on c:\twotones (where this all runs) to be "everyone" full control for all files and sub-directories.
The trigger batch also refers to TwoToneProcessCall.bat. That is nearly identical to the TwoToneProcess2 file but has no email, the recording time is set to 60:00, and the filename portion is this:
SET FileAmrTemp1=%SentFileName:~0,-4%.amr-nb
SET FileAmr=%SentFileName:~0,-4%.amr
SET FileMp3Temp1=%SentFileName:~0,-4%-temp1.mp3
SET FileMp3Temp2=%SentFileName:~0,-4%-temp2.mp3
SET FileMp3Temp3=%SentFileName:~0,-4%-temp3.mp3
SET FileMp3Short=%SentFileName:~0,-4%.mp3
It is a work in progress, but it has been working fine for me. Nice thing is that it can be altered easily and made to do all sorts of tricks based upon which page is processed, where it is being sent, etc.
All the tools I used are free.
So shall this be free for all to enjoy.
BAT files attached as plain text. Rename them.
Andy