WG/radio/Airtime Customization

The Airtime package's main Liquidsoap script is found by default in /usr/lib/airtime/pypo/bin/liquidsoap_bin/ls_script.liq.

We've made some changes to this script to add additional functionality:

(only the relevant bits of code are shown)

web_stream_enabled = ref true
 * 1) we change this variable to true.
 * 2) web_stream_enabled = ref false

web_stream_source_mono = audio_to_stereo((input.harbor("oblive-mono", port=8001, password="xxx"):source(1,0,0))) web_stream_source_stereo = input.harbor("oblive-stereo", port=8001, password="xxx")
 * 1) rather than monitor an http stream, we're going to use liquidsoap's built in functionality for collecting an http stream
 * 2) (it emulates icecast's). We'll define two streams, one for mono and another for stereo.
 * 3) web_stream_source = input.http(id="web_stream", autostart = false, buffer=0.5, max=20., "")

output.dummy(fallible=true, web_stream_source_mono) output.dummy(fallible=true, web_stream_source_stereo)
 * 1) once the stream is started, give it a sink so that liquidsoap doesn't
 * 2) create buffer overflow warnings in the log file.

s = switch(track_sensitive = false,   transitions=[to_live,to_live],    [      ({ !web_stream_enabled }, web_stream_source_mono),      ({ true }, s)    ] )
 * 1) the next two blocks add the live streams to the fallback list. We give priority to the stereo stream, then the mono stream,
 * 2) then whatever happens to be scheduled in airtime.
 * 3) We'll use some transitions defined in ls_lib.liq.

s = switch(track_sensitive = false,   transitions=[to_live,to_live],    [      ({ !web_stream_enabled }, web_stream_source_stereo),      ({ true }, s)    ] )

TODO: add a backup playlist at the bottom of the fallback list.