From: Romain B. <to...@ra...> - 2012-01-18 00:10:17
|
Hi Joey! 2012/1/11 Joey Weston <we...@sa...>: > Hi attached are my 3 scripts. > What I want to do is instead of restarting the main crosswavesradio.liq > running liquidsoap I want to combine the relay with the show functionality > so that when a live show starts the relay audio is overriden so I don't have > to keep killing the relay.liq instance of liquidsoap just to go live. What you need is a fallback :-) A fallback plays from the first source available in a list of sources. Here, you want to play live source if it is available, or play relayed stuff otherwise. Here's how to do it: live = (... live source ...) relay = (... relay source ...) # Combine the two, play live over relay whenever available radio = fallback( track_sensitive=false, [live, relay] ) Note the use of "track_sensitive=false" above: by default, the fallback may changes its source only at the end of a track. Here, we clearly want the live to start as soon as it is ready! For further evolved use of fallback, I'd recommend browsing through the online doc. Two points that you may want to read about are: * Custom transitions when switching back and forth. For instance add a jingle etc.. * Skip relay's current song when switching to the live source, so that it restarts with a fresh title when lives goes out. For this one, you may want to look at the code for the fallback.skip operator, which is defined in utils.liq (liquidsoap/scripts/utils.liq) Romain |