And still another Python based Tone Detector

Status
Not open for further replies.

W2ER

Member
Premium Subscriber
Joined
Jan 25, 2003
Messages
65
Location
Penfield, NY
All,

I did not realize that other people were working on a similar project. I see two other threads for tone detector programs. This one is all Python, no GUI and runs on Windows, Linux and OSX. By using the screen command in Linux it can be run detached from any screen.

It currently saves all pages, and selectively emails the dispatch audio to selected email address. This allows you to send pages to different people based on their interests.

I have been working on it for about a year now, and it has been stable for about the last 8 months. It is GNU GPL and the source code is available on sourceforge if anyone is interested in adding or modifying it. If you are interested in helping to continue the development let me know.

Any suggestions for improvement/features let me know as well.

The windows version is here:
Download seqtonedecoder from SourceForge.net

The source is here:
https://sourceforge.net/p/seqtonedecoder/code/ci/d03d1971c4d441141fddf92785687088201aa35a/tree/

Ed
 

W2ER

Member
Premium Subscriber
Joined
Jan 25, 2003
Messages
65
Location
Penfield, NY
BTW this also handles stacked pages very nicely. This is a line from the log file for a barn fire dispatch this evening.

2011-10-16 17:15:44,549 - INFO - toneDetect - processRecording - 517 - Page received for ['Hamlin', 'Hamlin Ambulance', 'Hilton FD 2', 'Hilton FD 1', 'Hilton FD 3', 'Walker', 'Brockport', 'Hamlin FD'].
 

Forts

Mentor
Database Admin
Joined
Dec 19, 2002
Messages
5,583
Location
Ontario, Canada
I'd like to give this a try. I see the tones go into the tonemap.csv file. What about the info for sending the email? Also it looks like it needs lame.exe. Just put it in the root directory?

Thanks for putting this out there!
 

W2ER

Member
Premium Subscriber
Joined
Jan 25, 2003
Messages
65
Location
Penfield, NY
I installed Audidgy and then copied lame.exe and the dll to the same directory as toneDetect.exe. Audidgy is a good program to have around when you are trouble shooting tones that don't show up properly

Ed
 

W2ER

Member
Premium Subscriber
Joined
Jan 25, 2003
Messages
65
Location
Penfield, NY
The email information goes in toneMap.csv

This is the basic format of the lines in toneMap.csv
DepartmentName,Tone1,Tone2,Tone3,Tone4,email1;email2;email3;...


Department Name is what shows up in the email as well as in the log.

Tone1 thru Tone4 are the tones in the order they will be received. For a two tone page 500,800,-1,-1 tells the program to match on 500 and 800 in that order. If the tone info was 500,800,900,-1 then it would match on only if it received all three tones in the order specified. See the Churchville FD line below for a real world example of a three tone page.

The email address comes after the tone information. I have tested up to 4 email addresses per tone sequence. There probably isn't any limit to the number of email addresses attached to any tone sequence.

Here is an example from my toneMap.csv

Brighton FD All-Call,600.9,600.9,-1,-1,emb@jetcom.org;edwardb@gmail.org
Brockport FD,1530.0,910.0,-1,-1,N/A
Churchville FD Ambulance,2807.0,1180.0,-1,-1,N/A
Churchville FD,2807.0,1180.0,2575.0,-1,emb@jetcom.org

The first line is a long tone Group call. The 600.9,600.9,-1,-1 tells it to look for the long tone, and to email me. Notice there are semicolons between multiple email addresses.

The second line is a standard two tone sequence. This one doesn't interest me so the N/A tells the program to just log it but don't send an email.

The third line is basically the same a line 2, log it but don't do anything else.

The fourth line is a three tone sequence 2807.0,1180.0,2575.0,-1 and my email address tells it to send the page to my email

The program records all pages and saves them to a directory with the date, time and department name as the file name. If there is an email address associated with that tone sequence then the mp3 file is sent via email.

The SMTP server info goes in the toneDetect.ini. in my case it is:
smtp_server = "smtp.rochester.rr.com"
I have added the ability to use gMail as well. The best bet is to use the one provided by your ISP since they don't usually require a user name and password.

If you want to try it you can send me the info and I can create the ini files you need. I think if you see it with your own info it will make more sense. If you have any other questions or I didn't really answer the one you asked let me know.

Ed
 

Forts

Mentor
Database Admin
Joined
Dec 19, 2002
Messages
5,583
Location
Ontario, Canada
Thanks for the info!

Was just looking in the toneDetect.ini (revision 224) and I don't have an entry for smtp server?

Edit: I just downloaded the latest version from Sourceforge and I see the smtp lines in the .ini now.
 
Last edited:

W2ER

Member
Premium Subscriber
Joined
Jan 25, 2003
Messages
65
Location
Penfield, NY
Yes it takes a pretty big chunk of CPU time. Some of that may be because of all the debugging I have in it. I will create a version without all that and see if that improves things.

For me I'm running it in a quad core cpu, so it isn't that big a deal, but for just general use it needs to be less cpu intensive.

Are you using the windows version or are you running it from the python source? I put a new windows version up yesterday (10/22/2011), with some refinements.

Ed
 

W2ER

Member
Premium Subscriber
Joined
Jan 25, 2003
Messages
65
Location
Penfield, NY
OK, I found the problem. I made a change and the CPU usage dropped from 25% to .5% or less. I uploaded a new windows version, so use that if you are going to try it.

Thanks Forts for reminding me to check into that.
 

Forts

Mentor
Database Admin
Joined
Dec 19, 2002
Messages
5,583
Location
Ontario, Canada
That's made quite a big difference. On my dual core machine CPU usage went from ~70% down to 25/30%.
 

W2ER

Member
Premium Subscriber
Joined
Jan 25, 2003
Messages
65
Location
Penfield, NY
Last edited:

W2ER

Member
Premium Subscriber
Joined
Jan 25, 2003
Messages
65
Location
Penfield, NY
In tonedetect.ini you can change deviceIndex = int(1) to the appropriate value. When you run tonedetect it will display the audio devices and the number associated with it


Ed
 
Status
Not open for further replies.
Top