1
0

Added liquidsoap script.

This commit is contained in:
Alexander Andreev 2022-08-29 07:18:07 +04:00
parent e94973920e
commit e1141e3d6f
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F
2 changed files with 68 additions and 0 deletions

52
configs/radio.liq Normal file
View File

@ -0,0 +1,52 @@
#!/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)
settings.log.stdout.set(false)
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)

16
configs/radio.vars.liq Normal file
View File

@ -0,0 +1,16 @@
# THIS FILE CAN BE SAFELY CHANGED
radio_url = "https://radio.arav.top"
radio_name = "Arav's dwelling / Radio"
radio_desc = "Broadcasting from under my desk."
radio_dir = "/srv/radio"
harbor_port = 8002
harbor_password = ""
icecast_host = "127.0.0.1"
icecast_port = 8000
icecast_password = ""
icecast_mount = "stream.ogg"
icecast_genre = "Various"