Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/liquidsoap
- #-----------------------------------------------------------
- # first the local files, for if the internal icecast is down
- emgFile = single("~radio/music/Emergancy.mp3")
- stPlaylist = playlist("~radio/st.pls")
- backup = fallback(id = "backup", track_sensitive = false, [stPlaylist, emgFile])
- #------------------------------------------------------------
- # now the EDH as the prefered backup
- edhRaw = input.http( id = "edh", "http://localhost:8040/edh.mp3")
- output.dummy(fallible=true,edhRaw)
- edh = fallback( id = "edh", track_sensitive=false, [edhRaw,backup])
- #-----------------------------------------------------------
- # and the DJ Channels
- dj01Raw = input.http( id = "dj01", "http://localhost:8040/dj01.mp3")
- dj02Raw = input.http( id = "dj02", "http://localhost:8040/dj02.mp3")
- dj03Raw = input.http( id = "dj03", "http://localhost:8040/dj03.mp3")
- dj04Raw = input.http( id = "dj04", "http://localhost:8040/dj04.mp3")
- dj05Raw = input.http( id = "dj05", "http://localhost:8040/dj05.mp3")
- dj06Raw = input.http( id = "dj06", "http://localhost:8040/dj06.mp3")
- dj07Raw = input.http( id = "dj07", "http://localhost:8040/dj07.mp3")
- dj08Raw = input.http( id = "dj08", "http://localhost:8040/dj08.mp3")
- dj09Raw = input.http( id = "dj09", "http://localhost:8040/dj09.mp3")
- dj10Raw = input.http( id = "dj10", "http://localhost:8040/dj10.mp3")
- output.dummy(fallible=true,dj01Raw)
- output.dummy(fallible=true,dj02Raw)
- output.dummy(fallible=true,dj03Raw)
- output.dummy(fallible=true,dj04Raw)
- output.dummy(fallible=true,dj05Raw)
- output.dummy(fallible=true,dj06Raw)
- output.dummy(fallible=true,dj07Raw)
- output.dummy(fallible=true,dj08Raw)
- output.dummy(fallible=true,dj09Raw)
- output.dummy(fallible=true,dj10Raw)
- dj01 = fallback( id = "dj01", track_sensitive=false, [dj01Raw, backup])
- dj02 = fallback( id = "dj02", track_sensitive=false, [dj02Raw, backup])
- dj03 = fallback( id = "dj03", track_sensitive=false, [dj03Raw, backup])
- dj04 = fallback( id = "dj04", track_sensitive=false, [dj04Raw, backup])
- dj05 = fallback( id = "dj05", track_sensitive=false, [dj05Raw, backup])
- dj06 = fallback( id = "dj06", track_sensitive=false, [dj06Raw, backup])
- dj07 = fallback( id = "dj07", track_sensitive=false, [dj07Raw, backup])
- dj08 = fallback( id = "dj08", track_sensitive=false, [dj08Raw, backup])
- dj09 = fallback( id = "dj08", track_sensitive=false, [dj09Raw, backup])
- dj10 = fallback( id = "dj10", track_sensitive=false, [dj10Raw, backup])
- # A call to an external script to see if source should be streaming:
- def is_s(source) =
- fun () -> test_process("~radio/djcheck #{source.id(source)}")
- end
- djswitch = switch(
- [ (is_s(dj01),dj01), (is_s(dj02),dj02),
- (is_s(dj03),dj03), (is_s(dj04),dj04),
- (is_s(dj05),dj05), (is_s(dj06),dj06),
- (is_s(dj07),dj07), (is_s(dj08),dj08),
- (is_s(dj09),dj09), (is_s(dj10),dj10),
- (is_s(edh),edh)] )
- djList = fallback(track_sensitive=false, [djswitch,backup])
- #-----------------------------------------------------------
- # now the broadcast section, this sends out the radio signal
- # and logs the metaadata
- radio = djList
- def feedback_metadata(m)
- system( "~radio/songChange #{source.id(radio)} #{quote(m['artist'])} #{quote(m['title'])} &")
- end
- radio = on_metadata(feedback_metadata, radio)
- output.icecast.mp3(
- host = "localhost", port = 8000, bitrate = 128,
- password = "hackme", mount = "/live.mp3", radio)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement