liquidsoap fallbacks explained

big balls of mud killer
, in 06 November 2014

Preventing Radio Castatrophy

not what liquidsoap looks like

In liquidsoap, the last thing you want is your users to hear silence. There are many reasons this could happen, the DJ fell asleep/got drunk, there’s a bad file in the playlist that cannot be played, etc.

The fallback function

In liquidsoap you can prevent disasters with fallbacks. If one source cannot be played, liquidsoap will gracefully fall back to another source. Here’s a typical setup:

backup_playlist = playlist("./playlist.txt",conservative=true,mode="normal",reload_mode="watch")
output.dummy(fallible=true,backup_playlist)

live_dj = input.harbor("live",port=9000)

on_fail = single("./technical_difficulties.wav")

source = fallback(track_sensitive=false,
                  [live_dj,backup_playlist,on_fail])

While some sources may be fallible, that’s ok if that are arranged in a cascading fallback, with the last source being unfallible. This way we can guarantee something should always be playing.

Modern Online Radio with Liquidsoap Book - Free Sample

Need more help with liquidsoap? Can’t get your script to work?

I wrote a book to help you learn Liquidsoap. The book covers all aspects of liquidsoap, from getting started, to making dynamic streams, audio processing, video, customizing metadata, authentication, and more. The book is available for purchase now here!

You can get a free sample chapter of my book! Just enter your email address to subscribe to my mailing list and I'll send you a free PDF sample of the book in return.