Radio-dodsorfas/state/liquidsoap/config/main.liq

77 lines
2.3 KiB
Plaintext
Raw Permalink Normal View History

2018-09-27 14:18:03 +02:00
set("log.file",false)
set("log.stdout",true)
set("server.telnet",true)
set("server.telnet.port", 5000)
set("server.telnet.bind_addr", "0.0.0.0")
set("decoder.file_extensions.gstreamer",["wav", "webm"])
set("decoder.mime_types.gstreamer",["audio/x-wav", "audio/wav", "video/webm"])
def crossfade(a,b)
add(normalize=false,
[ sequence([ blank(duration=5.),
fade.initial(duration=5.,b) ]),
fade.final(duration=5.,a) ])
end
live = audio_to_stereo(
rewrite_metadata(
[
("title", "$(title) (LIVE - Dodsorfas Radio)"),
("comment", "http://www.radio.dodsorf.as")
],
stretch(
ratio=interactive.float("test", 1.00005),
input.harbor(
"dodsorfas.live",
id="dodsorfas.live",
port=5002,
password=getenv("LIVE_PASSWORD"),
user="source",
logfile="/tmp/harbor.log"
)
)
)
)
2018-10-21 20:07:53 +02:00
normal_songs = playlist(reload=600, mime_type="application/x-mpegURL", "http://web/playlist.php")
halloween = playlist("/playlists/events/Halloween.m3u")
2019-11-09 21:04:14 +01:00
christmas = playlist("/playlists/events/Christmas.m3u")
2018-09-29 23:08:11 +02:00
2018-10-21 20:07:53 +02:00
requests = audio_to_stereo(drop_video(request.queue(id="request")))
2018-09-29 23:08:11 +02:00
2018-10-22 13:14:25 +02:00
jingles = playlist("/jingles")
2018-11-03 00:59:32 +01:00
def is_date(startd, startm, endd, endm)
2018-10-21 20:07:53 +02:00
localtime(time(), fun (~sec,~min,~hour,~mday,~mon,~year,~wday,~yday,~isdst) ->
2018-11-03 00:59:32 +01:00
mday >= startd and mon == startm-1 and mday <= endd and mon <= endm-1) # These are POSIX standards, mon: month of year [0,11]
2018-10-21 20:07:53 +02:00
end
2018-10-21 20:07:53 +02:00
default = switch([
2018-11-03 00:59:32 +01:00
({is_date(22, 10, 31, 10)}, random(weights = [1,5], [halloween, normal_songs])),
({is_date(1, 12, 28, 12)}, random(weights = [1,5], [christmas, normal_songs])),
2018-10-21 20:07:53 +02:00
({true}, normal_songs)
])
2018-09-29 23:08:11 +02:00
2018-10-21 20:07:53 +02:00
mix = blank()
mix = fallback(track_sensitive=false, [default, mix])
mix = fallback(track_sensitive=true, [requests,mix])
2018-09-29 23:08:11 +02:00
2018-10-21 20:07:53 +02:00
mix = random(weights=[9, 1], [mix, jingles])
2018-09-27 14:18:03 +02:00
mix = fallback(track_sensitive=false, transitions=[crossfade], [live, mix])
2018-10-21 20:07:53 +02:00
2018-10-15 19:00:03 +02:00
mix = normalize(mix)
2018-10-21 20:07:53 +02:00
mix = audio_to_stereo(mix)
2018-09-27 14:18:03 +02:00
# OUTPUTS
output.icecast(
password=getenv("HARBOR_PASSWORD"),
host=getenv("BROADCAST_PORT_5001_TCP_ADDR"),
port=int_of_string(getenv("BROADCAST_PORT_5001_TCP_PORT")),
%wav,
mount="dodsorfas.main",
mix
)