Author Topic: Resetting silence period  (Read 3771 times)

RadioMan

  • Newbie
  • *
  • Posts: 10
Resetting silence period
« on: March 06, 2014, 03:45:22 am »
I have an radio app that is terminated at silence and restarted.

The problem is SD doesn't reset its silence detection.

If the app hangs up BEFORE SOUND RESUMES, SD thinks everything is peachy and doesn't do anything.

There is a check box to reset, but only after sound resumes, so this fails.

How can I cause SD to either reset the detection event AFTER an alarm or force a SD shutdown and restart after the alarm?

Thanks!

Jan

  • Hero Member
  • *****
  • Posts: 1056
Re: Resetting silence period
« Reply #1 on: March 06, 2014, 10:26:57 am »
I think the SD already provides a solution for this situation. The alarm task queue may cycle in a loop from a selected line until the sound is finally detected. This loop may contain pauses, application restarts etc. The loop is created by the Repeat command.

RadioMan

  • Newbie
  • *
  • Posts: 10
Re: Resetting silence period
« Reply #2 on: March 06, 2014, 07:47:43 pm »
I think the SD already provides a solution for this situation. The alarm task queue may cycle in a loop from a selected line until the sound is finally detected. This loop may contain pauses, application restarts etc. The loop is created by the Repeat command.
Let me try to understand.

I put a line in to "initialize" my application. This is a kill command for the current play window. This allows me to accommodate any normal silence errors.

The next line starts the app up from a command line and automatically loads the parameter it needs to find the website.

If the sound starts, SD finishes its detection loop and goes back to listening for silence per the settings.

If sound does not start, the player app has stalled for some reason and just stops. It doesn't kill itself or allow a command line parameter to kill it if it errors. It just stops.

SD sees the app function but there is no sound so it does not finish the loop it started. Or maybe it does finish the alarm loop and just doesn't start looking for sound until it senses sound for the first time. I do not know.

There is a check box that forces it restart the detection cycle, but only if it detects sound.

This is where I am stalled right now.

I see I can add delays to the alarm queue, but they do not interfere with the executing code. Adding more instances of the radio software without killing the present instance produces a double feed. Bad bad bad for listening!

In short, I do not understand how I could use your idea to make this work.

If I could simply kill SD after an alarm action and then restart it (maybe with a batch file that kills SD and restarts it a few seconds later) I am certain that would work.

This would allow the radio software to be monitored and left alone unless an alarm condition, no sound indicating an error, occurs.

And maybe I am misunderstanding the whole thing...I'll keep experimenting.

RadioMan

  • Newbie
  • *
  • Posts: 10
Re: Resetting silence period
« Reply #3 on: March 07, 2014, 12:36:29 am »
Solved it!

It works great. No more permanent "idling" from my Internet radio software when it fails to locate the proper stream.

This works with Screamer radio.