Menu

#89 Silence detection on str_out_l+str_out_r

closed
nobody
None
5
2023-09-23
2018-06-02
Moonbase
No

I have a crude silence detection in my code (using Nicholas Humfrey’s »silentjack«) and use it for making the streaming light (yellow) flash whenever more than 5 s of less than -40 dB are detected on both str_out_l and str_out_r.

It’s of course not an elegant solution, since silentjack by itself can only connect to one port and I have to use threads and os.killpg() in the Python code, only to make an external program watch IDJC’s output and talk back to me via SIGUSR1 (crude, as I said).

The rationale was that sometimes songs DO have long parts of silence, and/or the announcer walks away to get a fresh coffee and a Player Stop or Announcement is due … And bingo! Silent stream!

I wonder if it would be feasible to integrate this within IDJC — I think you already know your output levels and everything, so I reckon it would be the better (and easier-to-handle) place for a function like this.

I would suggest (as I have now) the follwing parameters to be configurable:
Use silence detection (yes/no)
Level in dB below which the aggregated output (l+r) to the stream is considered "silence" (I currently use -40 dB).
Number of "silent" seconds before the detection triggers the callback.
It might also be nice to check Nicholas’ code—he has a "dynamic" option that would check for changing dynamics in the output, i.e., if I put a levelled 1kHz test tone on the system, it would eventually also fire (if so configured) because nothing "changes".

The callback function, I think, should fire whenever the STATE (silence or not) has changed and receive something like:
Whether we currently have silence or not (True/False)
Either how many seconds of silence now or at least the configured value (so I can fire a timer thread to reset the signal IF we don’t get kind of "silence has CHANGED" callback)
* It should probably only fire if we are actually streaming to at least one stream (or maybe not? does anyone use IDJC with external streamers?) But well, this part we could check ourselves in the monitor …

This should allow easy adaption to, say, my signalbox stuff, so I could maybe make the yellow light flash when the stream output went silent (and set it back later when something is output again).

I’d also really love to have the alarm_out triggered (with the same tone you use for end-of-media), either only once (when silence is detected first), or—even better—every (n) configured seconds (value from "seconds of silence before triggering" above). At least in my setup, the alarm_out is routed to an extra speaker anyway, so if the announcer walks away she can hear the alarm.

Well, this is my idea. To make IDJC do what I already do with external programs and clumsy Python code … Would save a lot of work explaining to others, too … :-)

Let me know what you think. Or if you wanr a peek in my current monitor to see what I do.

Discussion

  • Moonbase

    Moonbase - 2018-06-02

    Oops, my list bullets went away, sorry, can I edit this?

     
  • Stephen Fairchild

    Added a new silence detection feature using the loudness data. Indicates on the LU meter label and signals to idjcctrl. No audible alarm and not sure that's going to help the DJ do anything other than panic.

     
  • Stephen Fairchild

    • status: open --> accepted
     
  • Stephen Fairchild

    • status: accepted --> closed
     

Log in to post a comment.