TwoToneDetect Beta

Status
Not open for further replies.

Andy14120

Member
Joined
Jun 10, 2011
Messages
9
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
 

Attachments

  • TwoToneProcess2.txt
    7.9 KB · Views: 426
  • Trigger.txt
    747 bytes · Views: 177

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,300
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.

Awesome work Andy, thanks for sharing!

The other Andy
 

mpd4128

Member
Joined
Apr 19, 2007
Messages
12
Multi-Purpose Batch File

Ok, I am at wits end. I have a very elaborate system setup that basically acts just like a station monitor would. I have a computer setup with TwoToneDetect which records a 30 sec wav file, sends it to my email then launches a basic command to play my VFD's tone set. The problem is, I would really like to play the recorded file AFTER my VFD's tone set in the below manner.

Tone Recv'd from TwoToneDetect
30 sec wav recorded
email sent
---BATCH FILE BEGINS NOW----
Play wav file with pre-recorded tone set {called "Tones.wav"}
Play file which was JUST recorded by TwoToneDetect
Delete file which was JUST recorded by TwoToneDetect
---BATCH FILE ENDS NOW---

I already have the tone set wav playing AND the recording for each call deleting... what I can't figure out is how to make a variable name playback in mplay32. For those of you wondering, the reason I need it this way vs. just playing back live via the checkbox in TwoToneDetect is because we only get a short "alert tone" from our dispatch. This tone is no where near enough to wake me up on it's own and, even if it were, I wouldn't have the time to get my senses before the call is dispatched. At the station we get an audible alert from our speakers BEFORE the alert tones from our dispatch which gives us plenty of time to wake up enough for the call info.

Thanks in advance for any help and please don't hesitate to ask for further clarification if needed.
 

tjacks34

Member
Joined
Aug 1, 2009
Messages
63
Location
south rockwood mi
mpd4128
why not just use version 25 and the program already has an option to play an audio file upon tone detection, it just has to be a mono recording to play. So what i did was download the federal signal informer alert tone recorded it using audacity made it a mono file and had to play with the start and stop time and then check the box to play audio while recording, and that should do it for you
 

mpd4128

Member
Joined
Apr 19, 2007
Messages
12
Unfortunately I need the file to play AFTER a generated alert tone. The only way to do this is to playback the recorded file via the command field. I had a problem describing my need in my previous post but basically I am using this to wake me up at night time and our dispatch does not provide enough pause after the final alert tone for me to hear the dispatch info. Right now, all I get with two tone detect is a 3 second alert tone since the tone has already played prior to the file recording.
 

tjacks34

Member
Joined
Aug 1, 2009
Messages
63
Location
south rockwood mi
well cant you just make the delay bigger and that way the tone file wont play right away? then again there is always the option of having your pager reprogrammed to a fixed alert time you can set it from .5 seconds to a 2 minute alert with the minitor 5's i think the 3&4's are similar.

but if you want the file to play after the tone and call are dispatched you can just make an audio file make it silent for 20 seconds or so whatever the average length of a dispatch is and have it play upon tone detection
 

mpd4128

Member
Joined
Apr 19, 2007
Messages
12
Unfortunately, our VFD does not use Minitors but instead have fewer full blown mobile radios w/ standby capability for paging; thus I don't have a radio right now and am trying to come up with a temporary solution until they get me a radio on order.

As for the tone delay, that's not the problem. The problem I have is that I CAN'T use the live playback option because I need to ADD an alert tone before the dispatch info due to our dispatches inadequate alert tone. Hopefully my explanation below will make sense.

- Dispatch sends out tones (698 & 797)

- TwoToneDetect trigers on the B tone and start recording instantly

- All I hear on the recording is about 3 seconds of REMAINING B tone since the A tone and the majority of B tone have already sounded

- Now all I will hear with live playback is a three second "chirping" alarm followed closely by the dispatch info.

So, what I need to do is ADD an additional audible alarm (that I created) BEFORE the recorded dispatch info is played back. This would give me a better chance to wake up before hearing the dispatch info.
 

mpd4128

Member
Joined
Apr 19, 2007
Messages
12
To sum up my request/need, it would be great to have a "Playback recording AFTER command line execution".
 

tjacks34

Member
Joined
Aug 1, 2009
Messages
63
Location
south rockwood mi
yes that is what i am trying to tell you version 25 has that option it will play a wav file after the tones are met. so what will happen
A and B tones are met
Plays your .wav file alert tone what ever it may be as i said before it must be a mono recording
dispatch the call
 

mpd4128

Member
Joined
Apr 19, 2007
Messages
12
My apologies, I misunderstood. I downloaded that version a couple of days ago and completely missed this feature somehow! I will give it a try and let you know how it works for me.
 

mpd4128

Member
Joined
Apr 19, 2007
Messages
12
Unfortunately this setup still won't work for me. First, I did not receive the recorded wav file via email. Secondly, the recording/live playback doesn't start until AFTER your specified file has played out. This resulted in me missing the pertinent dispatch info all together. If the program were to start recording WHILE my specified file was playing and then start the live playback at the beginning of that recording it would be amazing. I still absolutely love the program and believe the creator is extremely talented. I applaud the effort clearly put into the program and even more so allowing it to stay freeware so that volunteers like myself can have a nice silent standby option at home. Before this I just used my scanner and annoyed my wife listening to all radio traffic for our specific tones... not only was it annoying to my wife but a very inaccurate way of receiving calls seeing as how it's hard for a human to single out one set of tones 100% of the time.
 

Andy14120

Member
Joined
Jun 10, 2011
Messages
9
Customized record and playback for goofy dispatch

Look back at my earlier post about stacked pages, silence removal, etc, for details of these tools
http://forums.radioreference.com/sc...120010-twotonedetect-beta-29.html#post1554122
You should be able to rearrange stuff to do exactly what you need.
Trigger a recording under 1 second just to call a batch file. Let that batch file use PSEXEC twice to trigger other processes.
Process 1: Batch file uses SOX to record audio. Then it plays it. Then it deletes it.
Process 2: Trigger playback of a 28 second audio file to wake you up. When it finishes, the other process will be right about at the playback time.

Andy
 

Emt812

Member
Joined
Jan 22, 2011
Messages
4
Location
Belle, MO
I have this program set up and it is detecting tones and recording audio to the default directory but it won't send the emails.

I thought maybe the email attachments might be too large so I reduced record time down to 5 seconds to reduce space but that hasn't helped at all. I am using a gmail account and have attempted various variations in the email fields with no success.
 

tjacks34

Member
Joined
Aug 1, 2009
Messages
63
Location
south rockwood mi
emt812
if you are using the new program version 25 then you need to download either the .lame or nokia converter, it's explained a few pages back and also on andys website under help file
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,300
Please see this thread in the forum next door for details on a new version of this program that I'm working on. I moved it to the recording and streaming audio forum because while the program does have some scanner control features, I think its true purpose is more in line with recording audio.

Thanks,

Andy
 

str3790

Newbie
Joined
Jan 9, 2011
Messages
1
Setting up the Email part

I think i am doing something wrong. The tones i have are activated and the "calls" are recorded. I go to the email i have it setup to send to and there is absolutely nothing on the email. I'm using Gmail. Here is the current settings i have in the program. SMTP Server: smtp.gmail.com .... Email Service: Authenticated ........... SMTP Port: 587 .... From email Adress: 37firstaidcall@gmail.com ...Email username: 37firstaidcall ....Password: (my password).
 

ac316scu

Member
Joined
Oct 25, 2009
Messages
59
I think i am doing something wrong. The tones i have are activated and the "calls" are recorded. I go to the email i have it setup to send to and there is absolutely nothing on the email. I'm using Gmail. Here is the current settings i have in the program. SMTP Server: smtp.gmail.com .... Email Service: Authenticated ........... SMTP Port: 587 .... From email Adress: 37firstaidcall@gmail.com ...Email username: 37firstaidcall ....Password: (my password).

did you download the lame mp3 encoder and put it in the correct folder?
 
Status
Not open for further replies.
Top