1
0
dwelling-radio/configs/radio.liq

57 lines
2.1 KiB
Plaintext
Raw Permalink 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"])
2022-08-29 22:17:31 +04:00
settings.log.level.set(2)
settings.log.file.set(true)
settings.log.file.path.set(log_file_path)
settings.log.stdout.set(false)
2022-08-29 07:18:07 +04:00
enable_replaygain_metadata()
2023-02-19 20:19:58 +04:00
fallback_song = mksafe(single(fullpath("fallback.ogg")))
fallback_song = metadata.map(fallback_alter_title, fallback_song)
2022-08-29 07:18:07 +04:00
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 = metadata.map(fun (_) -> [("artist", radio_name), ("title", "Live Show")], live_show)
2022-08-29 07:18:07 +04:00
playlist_random = playlist(fullpath("playlists/all-rand"),
prefix = string.concat(["replaygain:", fullpath("music/")]),
2022-08-29 07:18:07 +04:00
mode = "normal", reload_mode = "watch")
music = audio_to_stereo(playlist_random)
music = replaygain(music)
music = normalize(music, target = -7., threshold = -75.)
2022-08-29 07:18:07 +04:00
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])
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)