1
0
dwelling-radio/configs/radio.liq

52 lines
1.9 KiB
Plaintext
Raw Normal View History

2022-08-29 07:18:07 +04:00
#!/usr/bin/liquidsoap
# DO NOT EDIT! WILL BE REPLACED WITH A NEW UPDATE!
%include "radio.vars.liq"
def fullpath(p)
string.concat([radio_dir, p])
end
def xfade(a, b)
add(normalize = false,
[ sequence([ blank(duration = 2.),
fade.initial(duration = 2., b)]),
fade.final(duration = 2., a)])
end
def fallback_alter_title(m) =
[("artist", radio_name),
("title", string.concat(["No stream. (Playing ", m["artist"], " - ", m["title"], ")"]))]
end
settings.server.telnet.set(false)
settings.harbor.bind_addrs.set(["0.0.0.0"])
settings.log.file.set(false)
2022-08-29 10:07:01 +04:00
settings.log.stdout.set(true)
2022-08-29 07:18:07 +04:00
fallback_song = mksafe(single(fullpath("fallback.mp3")))
fallback_song = map_metadata(fallback_alter_title, fallback_song)
live_mixin = input.harbor("adr-live-mixin", port = harbor_port, password = harbor_password)
live_show = input.harbor("adr-live-show", port = harbor_port, password = harbor_password)
live_show = map_metadata(fun (_) -> [("artist", radio_name), ("title", "Live Show")], live_show)
playlist_random = playlist(fullpath("playlists/all-rand"),
prefix = fullpath("music/"),
mode = "normal", reload_mode = "watch")
music = audio_to_stereo(playlist_random)
radio = smooth_add(p = 0.18, normal = music, special = live_mixin)
radio = fallback(track_sensitive = false,
transitions = [xfade, xfade, xfade],
[ blank.strip(max_blank=15., live_show),
blank.strip(max_blank=90., radio), fallback_song])
radio = normalize(radio)
output.icecast(%vorbis.cbr(bitrate = 128, samplerate = 44100, channels = 2),
host = icecast_host, port = icecast_port,
password = icecast_password, encoding = "utf-8",
name = radio_name, description = radio_desc, public = true,
mount = icecast_mount, url = radio_url, genre = icecast_genre,
radio)