Skip to content

Instantly share code, notes, and snippets.

@rmcauley
Created March 19, 2016 05:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmcauley/6d8874fb19e9c2718f6c to your computer and use it in GitHub Desktop.
Save rmcauley/6d8874fb19e9c2718f6c to your computer and use it in GitHub Desktop.
r4_offline_file = "/home/icecast/~misc/cover-offline.mp3"
r4_sid = "3"
r4_dest_mount = "covers"
r4_dest_desc = "Rainwave Covers"
r4_dest_url = "http://covers.rainwave.cc"
r4_harbor_port = 31233
##################
set("log.level", 3)
set("log.file.path","/var/log/liquidsoap/"^r4_dest_mount^".log")
set("harbor.timeout", 4.)
%include "/etc/liquidsoap/_crossfade.liq.util"
set("server.socket", true)
set("server.socket.path", "/var/run/liquidsoap/<script>.sock")
set("server.socket.permissions", 438) # translates to 666 permissions but needs to be in octal format
set("server.timeout", -1.)
r4_harbor_pw = interactive.string("harbor_pw", "no_password_at_all")
def r4_backend() =
result = get_process_output("/opt/rainwave/rw_get_next.py --sid "^r4_sid)
request.create(result)
end
def r4_live_auth(user, password) =
if password == r4_harbor_pw() then
true
else
false
end
end
r4_auto = request.dynamic(r4_backend, length=6.0, conservative=false)
r4_auto = amplify(0.7, override="replay_gain", audio_to_stereo(r4_auto))
r4_auto = smart_crossfade(r4_auto)
r4_auto = rewrite_metadata([("title", '$(if $(use_suffix),"$(title) $(suffix)","$(title)")'), ("url", r4_dest_url)], r4_auto)
r4_offline = single(r4_offline_file)
r4_auto = fallback([r4_auto, r4_offline], track_sensitive=false)
r4_live = input.harbor("/dj.mp3", id="dj_harbor", port=r4_harbor_port, auth=r4_live_auth);
r4_livemix = smooth_add(delay=0.5, p=0.15, normal=r4_auto, special=r4_live)
# output removed to protect passwords
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment