From: Matt C. <ma...@no...> - 2014-02-18 21:27:43
|
Hi, So I'm trying to tweak the silence detection for my script, however I am struggling to define what 'silence' actually is, and how the strip_blank threshold value relates to the output of rms() I've implemented rms() via the telnet server to measure values, however the values seem to vary quite a lot. For example: 1000hz sinewave @ 0dB: 0.436315828817 via rms() 1000hz sinewave @ -20dB: 0.418433339027 via rms() 1000hz sinewave @ -30dB: 0.418379714679 via rms() Yet to have strip_blank() trigger at around -30dB requires setting the threshold to -7.41 Is there any way to relate these two measurements to each other? I am looking for a way to generate a reference tone at the specific volume where I want to trigger the silence detection without having to do endless trial and error adjusting the threshold. Fyi, relevant bits of my script: live = input.alsa(device="hw:0,0") duration = interactive.float("duration", 1.) rs = rms.stereo(duration=duration,live) r = fst(rs) live = snd(rs) def rms_left(_) = "#{fst(r())}" end def rms_right(_) = "#{snd(r())}" end server.register("rms_left",rms_left) server.register("rms_right",rms_right) backup = single("/outcast_config/backup.mp3") live = fallback(track_sensitive=false, [ strip_blank(threshold=-7.41,max_blank=1.0,live) , backup ]) |