TwoToneDetect New TwoToneDetect in the works - Python based

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
Hello, everyone.

Unfortunately, the home server I was running TTD on crashed a several weeks ago and I've been trying to resurrect TTD on a new one. I'm having a problem that I didn't run into the first time, and I'm just looking to see if somebody can point me in the right direction. TTD recognizes the tones accurately and activates, but the recording sounds slow/warped (it's half speed - if I play it back at double-time with Audacity it becomes intelligible) and the file is twice as long as the test audio length. It's like something in the recording process stretched the audio out. After reviewing some previous posts here, I suspect it's an issue with the sampling rate, but no matter what adjustments I make, I can't fix the issue.

I tried changing the TTD setting for MP3 bitrate, left/right/mono audio, various settings for the USB audio adapter. Nothing seems to do the trick. While troubleshooting, I was able to determine that the original WAV being recorded also sounds the same way, before it's converted into MP3, so the problem isn't in the conversation process. I also tried recording the scanner audio using a different application (Audacity) and that works OK. I also noticed that my original TTD server Windows 7) was set to mono in the config file, but if I select that on the new machine (Windows 10) I get no audio. If I choose either Left or Right, I get the scanner audio. It's the same USB sound adapter. I did also grab another USB sound adapter I had laying around (different model) and experienced the same problem with that one, too.

Hopefully something I've missed will pop out for somebody. I'm really scratching my head over here. Thanks!
Those USB sound cards are almost always mono in the actual hardware, and that's what you'd normally want TTD set to. Not getting any audio when set to mono in TTD is unusual. And if you set it to stereo when it's actually a mono sound card I'd actually expect the opposite problem...audio being too fast as half the samples (for the opposite channel) get thrown out when in stereo.

I've seen a very few reports of this in the past. I'm not sure we ever conclusively determined root cause. In at least two cases, reinstalling TTD seemed to solve it for the people having the issue, but never determined why that helped.
 

Jay911

Silent Key (April 15th, 2023)
Feed Provider
Joined
Feb 15, 2002
Messages
9,378
Location
Bragg Creek, Alberta
Is there a setting within TTD (IAR version, if that matters) that causes it to stop listening for tones for a period of time when a tone is detected that is NOT in its list?

Recently our comms/dispatch has changed from sending only our tone plus our voice alert message on our alerting channel, to sending the tones for all dispatched stations, then our voice, on our channel (kind of like what you used to hear on *Emergency!*, where several series of tones will be played before the actual voice alert message is sent). It's a configuration change from the alerting end that I'm working with the alerting vendor to try to revert to the previous method.

My problem is that TTD is not detecting my tones when they are played as the second in order, after the first one, before the voice message. What's happening is there is the first tone (for a station that my TTD is not configured to do anything with), about a 1000 ms pause, then my tones, then another pause, then the voice. In situations where my tones are the only tones played, TTD is pretty consistently capturing them and sending the alert notification, making and emailing the recording, etc. What I've found is that when other stations' tones are played before mine, as above, TTD is for some reason NOT recognizing my tones and doing the alerts, recordings, emails, and so on.

If I can't get this reverted to the previous method where my tones and only my tones are played prior to the alert, is there some setting I should be looking for in TTD to make it recognize and capture my tones when they're not the first ones sent?
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
Is there a setting within TTD (IAR version, if that matters) that causes it to stop listening for tones for a period of time when a tone is detected that is NOT in its list?

Recently our comms/dispatch has changed from sending only our tone plus our voice alert message on our alerting channel, to sending the tones for all dispatched stations, then our voice, on our channel (kind of like what you used to hear on *Emergency!*, where several series of tones will be played before the actual voice alert message is sent). It's a configuration change from the alerting end that I'm working with the alerting vendor to try to revert to the previous method.

My problem is that TTD is not detecting my tones when they are played as the second in order, after the first one, before the voice message. What's happening is there is the first tone (for a station that my TTD is not configured to do anything with), about a 1000 ms pause, then my tones, then another pause, then the voice. In situations where my tones are the only tones played, TTD is pretty consistently capturing them and sending the alert notification, making and emailing the recording, etc. What I've found is that when other stations' tones are played before mine, as above, TTD is for some reason NOT recognizing my tones and doing the alerts, recordings, emails, and so on.

If I can't get this reverted to the previous method where my tones and only my tones are played prior to the alert, is there some setting I should be looking for in TTD to make it recognize and capture my tones when they're not the first ones sent?
TTD can definitely handle this. This type of "stacked tones" paging is very common and widely used. Can you post or send me a log file from when it's not working?
 

R_Rabbit10

Member
Joined
Mar 9, 2013
Messages
39
I need to run the software as administrator for it to function in W10Pro. I get the following error message otherwise: "Failed to execute script TwoToneDetect".

Once I have the software running, I get proper IAR pre-alerts, however it does not send the audio files and I see the following failures in the log files:
IAR Intergrated version:
Code:
DEPARTMENT - 5eSTRINGSTRTING7b Tone Set Found
mutation {addAlert(ttdReceivedDate: "2023-04-20T20:53:42Z", pagerGroup: ["5eSTRINGSTRTING7b"]){_id textAlert pagerGroup subscriberId}}
564.6951219512196 1892 1682024022.9239676
564.6951219512196 1893 1682024023.1139338
{'data': {'addAlert': {'_id': '6441a657c462d9c3c57b3bd0', 'textAlert': 'DEPARTMENT Received at 14:53:43 04/20/2023', 'pagerGroup': 'DEPARTMENT', 'subscriberId': 882}}}
succesfully sent IaR prealert
starting new alert at 1682024023.1451554
[[['DEPARTMENT - 5eSTRINGSTRTING7b', 1682024022.7489407, '6441a657c462d9c3c57b3bd0']]]
Traceback (most recent call last):
File "TwoToneDetect.py", line 1774, in alert
File "pyaudio.py", line 754, in open
OSError: [Errno -9999] Unanticipated host error
delay timer DEPARTMENT - 5eSTRINGSTRTING7b 14:53:43 on 04/20/23
Traceback (most recent call last):
File "TwoToneDetect.py", line 1797, in alert
UnboundLocalError: local variable 'recordstream' referenced before assignment
something went wrong in alert thread - removing alert_list_local: [['DEPARTMENT - 5eSTRINGSTRTING7b', 1682024022.7489407, '6441a657c462d9c3c57b3bd0']]
564.6951219512196 1889 1682024023.2939336
MP3 Sending Email Version:

Code:
DEPARTMENT Tone Set Found
starting new alert at 1682024022.8481507
[[['DEPARTMENT', 1682024022.8481507, 0]]]
Traceback (most recent call last):
File "TwoToneDetect.py", line 1774, in alert
File "pyaudio.py", line 754, in open
OSError: [Errno -9999] Unanticipated host error
delay timer DEPARTMENT 14:53:42 on 04/20/23
Traceback (most recent call last):
File "TwoToneDetect.py", line 1797, in alert
UnboundLocalError: local variable 'recordstream' referenced before assignment
something went wrong in alert thread - removing alert_list_local: [['DEPARTMENT', 1682024022.8481507, 0]]
592.9298780487806 1892 1682024023.0339339

Tried on 74c&d and both version give me these errors.

Any thoughts?
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
I need to run the software as administrator for it to function in W10Pro. I get the following error message otherwise: "Failed to execute script TwoToneDetect".

Once I have the software running, I get proper IAR pre-alerts, however it does not send the audio files and I see the following failures in the log files:
IAR Intergrated version:
Code:
DEPARTMENT - 5eSTRINGSTRTING7b Tone Set Found
mutation {addAlert(ttdReceivedDate: "2023-04-20T20:53:42Z", pagerGroup: ["5eSTRINGSTRTING7b"]){_id textAlert pagerGroup subscriberId}}
564.6951219512196 1892 1682024022.9239676
564.6951219512196 1893 1682024023.1139338
{'data': {'addAlert': {'_id': '6441a657c462d9c3c57b3bd0', 'textAlert': 'DEPARTMENT Received at 14:53:43 04/20/2023', 'pagerGroup': 'DEPARTMENT', 'subscriberId': 882}}}
succesfully sent IaR prealert
starting new alert at 1682024023.1451554
[[['DEPARTMENT - 5eSTRINGSTRTING7b', 1682024022.7489407, '6441a657c462d9c3c57b3bd0']]]
Traceback (most recent call last):
File "TwoToneDetect.py", line 1774, in alert
File "pyaudio.py", line 754, in open
OSError: [Errno -9999] Unanticipated host error
delay timer DEPARTMENT - 5eSTRINGSTRTING7b 14:53:43 on 04/20/23
Traceback (most recent call last):
File "TwoToneDetect.py", line 1797, in alert
UnboundLocalError: local variable 'recordstream' referenced before assignment
something went wrong in alert thread - removing alert_list_local: [['DEPARTMENT - 5eSTRINGSTRTING7b', 1682024022.7489407, '6441a657c462d9c3c57b3bd0']]
564.6951219512196 1889 1682024023.2939336
MP3 Sending Email Version:

Code:
DEPARTMENT Tone Set Found
starting new alert at 1682024022.8481507
[[['DEPARTMENT', 1682024022.8481507, 0]]]
Traceback (most recent call last):
File "TwoToneDetect.py", line 1774, in alert
File "pyaudio.py", line 754, in open
OSError: [Errno -9999] Unanticipated host error
delay timer DEPARTMENT 14:53:42 on 04/20/23
Traceback (most recent call last):
File "TwoToneDetect.py", line 1797, in alert
UnboundLocalError: local variable 'recordstream' referenced before assignment
something went wrong in alert thread - removing alert_list_local: [['DEPARTMENT', 1682024022.8481507, 0]]
592.9298780487806 1892 1682024023.0339339

Tried on 74c&d and both version give me these errors.

Any thoughts?
It's having trouble accessing the sound card to record the audio after an alert is detected. This seems to happen sometimes when using the computer's built-in sound card. Using an external USB audio adapter may help.
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
v74e Available

v74e is now available via the IaR form (website link to the form is still down, I'm not sure when it will be back up).

Release Notes:
  • Bug fix for config editor GUI

Andy
 

MikeOrlando02

Member
Joined
Oct 8, 2015
Messages
97
I just installed v74d this past weekend and I am seeing this traceback in my logs. I had a crash of some sort on Monday and both my EMS and Fire instances stopped working... possibly an issue with Windows / Win Update so will monitor. I will install v74e and observe.

Tone Set Found
Traceback (most recent call last):
File "TwoToneDetect.py", line 1717, in alert
UnboundLocalError: local variable 'lowtime' referenced before assignment
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
I just installed v74d this past weekend and I am seeing this traceback in my logs. I had a crash of some sort on Monday and both my EMS and Fire instances stopped working... possibly an issue with Windows / Win Update so will monitor. I will install v74e and observe.

Tone Set Found
Traceback (most recent call last):
File "TwoToneDetect.py", line 1717, in alert
UnboundLocalError: local variable 'lowtime' referenced before assignment
Ok, thanks for the heads up. I'm heading out of town and won't be able to dig into this until next week, but it looks like there may be a bug there.

Andy
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
I just installed v74d this past weekend and I am seeing this traceback in my logs. I had a crash of some sort on Monday and both my EMS and Fire instances stopped working... possibly an issue with Windows / Win Update so will monitor. I will install v74e and observe.

Tone Set Found
Traceback (most recent call last):
File "TwoToneDetect.py", line 1717, in alert
UnboundLocalError: local variable 'lowtime' referenced before assignment
It's related to the Exclude Times, so double check that those are correctly formatted in your config file.
 

MikeOrlando02

Member
Joined
Oct 8, 2015
Messages
97
It's related to the Exclude Times, so double check that those are correctly formatted in your config file.
I do not use exclude time and they are not defined in my config files. Does it need to devised as some value to indicate it is disabled?
 

mocofeed

Member
Premium Subscriber
Joined
Jul 18, 2018
Messages
104
I've tried searching threads, but I haven't found an answer to my problem. I keep getting:

set up mail server starting TLS done starting TLS logging in logged in
Traceback (most recent call last):
File "Two ToneDetect.py', line 1444, in mail File "smtplib.py", line 888, in sendmail
smtplib.SMTPDataError: (501, b'Syntax error - line too long')
Email not sent via smtp mail com on port 587 using STARTTLS on attempt 2 trying again in five seconds for Station7Rescue setting mail server up set up mail server starting TLS done starting TLS logging in logged in
Traceback (most recent call last):
File "TwoTone Detect. py', line 1444, in mail File "smtplib.py', line 888, in sendmail



What am I doing wrong?
 

MikeOrlando02

Member
Joined
Oct 8, 2015
Messages
97
I've tried searching threads, but I haven't found an answer to my problem. I keep getting:

set up mail server starting TLS done starting TLS logging in logged in
Traceback (most recent call last):
File "Two ToneDetect.py', line 1444, in mail File "smtplib.py", line 888, in sendmail
smtplib.SMTPDataError: (501, b'Syntax error - line too long')
Email not sent via smtp mail com on port 587 using STARTTLS on attempt 2 trying again in five seconds for Station7Rescue setting mail server up set up mail server starting TLS done starting TLS logging in logged in
Traceback (most recent call last):
File "TwoTone Detect. py', line 1444, in mail File "smtplib.py', line 888, in sendmail



What am I doing wrong?
That email/SMTP provider are you using?
 

mocofeed

Member
Premium Subscriber
Joined
Jul 18, 2018
Messages
104
I have looked high and low to find the link again, but there was someone who had a website that listed TTD pages. It was basically a series of links to MP3 files from the TTD program. If you know of the site please advise. TIA
 

MikeOrlando02

Member
Joined
Oct 8, 2015
Messages
97
Anyone having issues sending AMR pages to ATT users who using mms.att.net? Our ATT users for the past week and a half have reported not getting their pages. When I checked our outgoing email account, I see more bounces from ATT users than usual:

att-e2xms-west.mx.a.cloudfilter.net[35.82.99.184] said: 550 5.1.1
recipient address rejected (in reply to RCPT TO command)

Normally I would say it's a bad number or they changed carriers, but I am seeing this with multiple ATT users from different tone sets. I even emailed directly from the mail service we use (fastmail), my personal email, and corporate email and get similar bounce messages so I know it isn't specific to TTD.

Did ATT do something with their MMS gateway domain or change their antispam rules? Anyone else seeing similar?
 
Top