Audio Fallback needed (in answer to #229)

I was looking at a way to remove dead air in case that a track fails, ends prematurely, or maybe worse.
After a lot of searching and reading the info from defect 229 (if that is a defect, don’t think so)
I came up with the following.
the LiquidSoap file ls_script.liq would be the one needing a small but simple modification.
(in my case the change starts at line 178)

# EWCMI Change
#default = amplify(id="silence_src", 0.00001, noise())
# Play Offline Jingle when Offline
interlude = single("/srv/airtime/stream_unavailable.mp3")
default = fallback(track_sensitive=false, [ strip_blank(max_blank=50.,stream_queue) , interlude ])

ref_off_air_meta = ref off_air_meta
if !ref_off_air_meta == "" then
        # EWCMI Change
    #ref_off_air_meta := "LibreTime - offline"
    ref_off_air_meta := "Eagle Wings Radio - offline"
end
# EWCMI Change
# default = rewrite_metadata([("title", !ref_off_air_meta)], default)
ignore(output.dummy(default, fallible=true))

This change does a couple of things, it makes available a file and identifies it by interlude.
Then changes the amplify silence (to make sure Icecast doesn’t fall over when available) to a fallback stream (interlude) with a silence of 50 seconds or bigger.
50 seconds seems like a long time, but as we are a ministry which will broadcast services including prayer etc. it might sometimes have a real low, I mean real low audio level. thus for us 50 seconds works.
And finally it changes the metadata to display “Eagle Wings Radio offline”

we’ve also created an update.txt file in the root of the libretime user which explains and give the commands for what needs to be done after an update. (cut and past or scripting is much easier then retyping)


Stream Unavailable file

cp -fp /usr/local/lib/python2.7/dist-packages/airtime_playout-1.0-py2.7.egg/liquidsoap/ls_script.liq /usr/local/lib/python2.7/dist-packages/airtime_playout-1.0-py2.7.egg/liquidsoap/ls_script.liq_BU
cp -fp /home/ewcmiradio/scripts/ls_script.liq /usr/local/lib/python2.7/dist-packages/airtime_playout-1.0-py2.7.egg/liquidsoap/ls_script.liq
service airtime-liquidsoap restart

I hope this helps.
Pst. Chris.