Created
October 18, 2016 09:53
-
-
Save mabe-at/df2c08176abb3a914da37370963b3959 to your computer and use it in GitHub Desktop.
Automatic switch to live-stream with liquidsoap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/liquidsoap | |
# Music | |
myplaylist = playlist("<path_to_playlist>/playlist.m3u") | |
# If something goes wrong, we'll play this | |
security = single("<path_to_fallback>/fallback-loop.mp3") | |
# optional speech generator | |
livesoon = single("say:We are live soon!") | |
# Build feed by rotating playlist and speech | |
radio = rotate(weights=[1,1],[ myplaylist, livesoon ]) | |
# amplify to match live volume level | |
radio = amplify(0.1,override="replay_gain",radio) | |
# And finally build stream, which switches to live stream, if there is any signal | |
finalradio = fallback(track_sensitive = false, [input.http("<url_to_icecast_live>"), radio, security]) | |
# Stream this to icecast | |
output.icecast(%mp3(bitrate=96), | |
host = "<icecast_server>", | |
port = <port>, | |
password = "<source_password>", | |
mount = "<mount_point>", | |
url = "<metadata_url>", | |
name = "<metadata_name>", | |
description = "<metadata_description>", | |
genre = "<metadata_genre>", | |
finalradio) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment