I am setting up a system based on liquidsoap to stream and record the audio from a program used to decode digital radio transmissions (OP25). Currently I am getting the output from and external source, in the following way:
*input = input.external(buffer=0.25, channels=2, samplerate=8000, restart_on_error=false, "./audio.py -s")* Afterwards I perform some processing and I output the audio on the loudspeakers: *input2 = mksafe(input)input2 = filter.iir.butterworth.high(frequency = 200.0, order = 4, input2)input2 = filter.iir.butterworth.low(frequency = 3250.0, order = 4, input2)input2 = compress(input2, attack = 2.0, gain = 0.0, knee = 13.0, ratio = 2.0, release = 12.3, threshold = -18.0, rms_window = 1.0)input2 = normalize(input2, gain_max = 6.0, gain_min = -6.0, target = -18.0, threshold = -65.0)input2 = ladspa.tap_limiter(input2, limit_level = -1.0)input2 = limit(input2, threshold = -0.2, attack = 2.0, release = 25.0, rms_window = 0.02)out (input2)* I have no problem on this part, which is working fine... BUT I wuold also like to output the audio on an mp3 file. As the audio are conversations on a radio channel there are long pauses/silences in the transmission, which I don't want to record. For this reason I am using the original "input" (not the one after mksafe, which contains silences): *# dump recordings to a filetime_stamp = '%Y-%m-%d_%H.%M.%S'output.file(%mp3, "./OUT_#{time_stamp}.mp3", input, fallible=true)* Basically it works, but the problem is that everytime the buffer ends a new small and empty mp3 file gets written, which is not the expected behaviour (I wuold like to have a new file only when a conversation is happening). This is a part of the log that shows the file gets written again: *2021/01/05 10:19:10 [input.external_7745:6] Not ready: need more buffering (1920/2000).2021/01/05 10:19:10 [input.external_7745:6] Not ready: need more buffering (1920/2000).2021/01/05 10:19:10 [input.external_7745:6] Not ready: need more buffering (1920/2000).2021/01/05 10:19:10 [mksafe:3] Switch to input.external_7745 with transition.2021/01/05 10:19:10 [safe_blank:4] Activations changed: static=[], dynamic=[mksafe:iir_filter_7750:iir_filter_7752:compress_7754:normalize_7757:ladspa_7759:compress_7761:mksafe:pulse_out(liquidsoap:):pulse_out(liquidsoap:)].2021/01/05 10:19:10 [input.external_7745:4] Activations changed: static=[mksafe:iir_filter_7750:iir_filter_7752:compress_7754:normalize_7757:ladspa_7759:compress_7761:mksafe:pulse_out(liquidsoap:):pulse_out(liquidsoap:), (dot)/OUT_%Y-%m-%d_%H(dot)%M(dot)%S(dot)mp3:(dot)/OUT_%Y-%m-%d_%H(dot)%M(dot)%S(dot)mp3], dynamic=[mksafe:iir_filter_7750:iir_filter_7752:compress_7754:normalize_7757:ladspa_7759:compress_7761:mksafe:pulse_out(liquidsoap:):pulse_out(liquidsoap:)].2021/01/05 10:19:10 [input.external_7745:4] End of track.2021/01/05 10:19:10 [input.external_7745:4] Buffer emptied, buffering needed.2021/01/05 10:19:10 [input.external_7745:6] Not ready: need more buffering (0/2000).2021/01/05 10:19:10 [mksafe:3] Switch to safe_blank with forgetful transition.2021/01/05 10:19:10 [input.external_7745:4] Activations changed: static=[(dot)/OUT_%Y-%m-%d_%H(dot)%M(dot)%S(dot)mp3:(dot)/OUT_%Y-%m-%d_%H(dot)%M(dot)%S(dot)mp3], dynamic=[mksafe:iir_filter_7750:iir_filter_7752:compress_7754:normalize_7757:ladspa_7759:compress_7761:mksafe:pulse_out(liquidsoap:):pulse_out(liquidsoap:)].2021/01/05 10:19:10 [safe_blank:4] Activations changed: static=[mksafe:iir_filter_7750:iir_filter_7752:compress_7754:normalize_7757:ladspa_7759:compress_7761:mksafe:pulse_out(liquidsoap:):pulse_out(liquidsoap:)], dynamic=[mksafe:iir_filter_7750:iir_filter_7752:compress_7754:normalize_7757:ladspa_7759:compress_7761:mksafe:pulse_out(liquidsoap:):pulse_out(liquidsoap:)].2021/01/05 10:19:10 [input.external_7745:6] Not ready: need more buffering (0/2000).2021/01/05 10:19:10 [input.external_7745:6] Not ready: need more buffering (0/2000).2021/01/05 10:19:10 [input.external_7745:6] Not ready: need more buffering (0/2000).2021/01/05 10:19:10 [(dot)/OUT_%Y-%m-%d_%H(dot)%M(dot)%S(dot)mp3:3] Source failed (no more tracks) stopping output...2021/01/05 10:19:10 [input.external_7745:6] Not ready: need more buffering (0/2000).2021/01/05 10:19:10 [input.external_7745:6] Not ready: need more buffering (0/2000).* How could I configure liquidsoap to write a new file only when some audio is present on the input and not everytime the buffer ends? Thank you. -miclass
_______________________________________________ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users