mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-19 08:12:09 +00:00
Documentation of radio_conjurer.liq
This commit is contained in:
@@ -1,25 +1,43 @@
|
|||||||
|
# FILEPATH: /home/mtuszowski/conjurer/conjurer_musician/radio_conjurer.liq
|
||||||
|
|
||||||
|
# This script sets up a Liquidsoap radio stream with various features and configurations.
|
||||||
|
|
||||||
|
# Load icecast credentials from a JSON file
|
||||||
let json.parse credentials = file.contents("/home/pi/Conjurer/icecast_credentials.json")
|
let json.parse credentials = file.contents("/home/pi/Conjurer/icecast_credentials.json")
|
||||||
|
|
||||||
|
# Enable replaygain metadata processing
|
||||||
enable_replaygain_metadata()
|
enable_replaygain_metadata()
|
||||||
|
|
||||||
|
# Define playlists to be used in the stream
|
||||||
s1 = replaygain(playlist(reload_mode="watch", "/home/pi/Conjurer/all_playlist.playlist"))
|
s1 = replaygain(playlist(reload_mode="watch", "/home/pi/Conjurer/all_playlist.playlist"))
|
||||||
s2 = replaygain(playlist(reload_mode="watch", "/home/pi/Conjurer/priority_queue.playlist"))
|
s2 = replaygain(playlist(reload_mode="watch", "/home/pi/Conjurer/priority_queue.playlist"))
|
||||||
s3 = replaygain(playlist(reload_mode="watch", "/home/pi/Conjurer/hit.playlist"))
|
s3 = replaygain(playlist(reload_mode="watch", "/home/pi/Conjurer/hit.playlist"))
|
||||||
|
|
||||||
|
# Randomly select a playlist with weights
|
||||||
s = random(id="randomizer", weights=[1, 3, 2], [s1, s2, s3])
|
s = random(id="randomizer", weights=[1, 3, 2], [s1, s2, s3])
|
||||||
|
|
||||||
|
# Set up an interactive harbor for controlling the stream
|
||||||
interactive.harbor(port = 9999)
|
interactive.harbor(port = 9999)
|
||||||
|
|
||||||
|
# Set up interactive controls for bass boost
|
||||||
f = interactive.float("f", description="Frequency", min=0., max=1000., unit="Hz", 200.)
|
f = interactive.float("f", description="Frequency", min=0., max=1000., unit="Hz", 200.)
|
||||||
g = interactive.float("g", description="Gain", min=0., max=20., unit="dB", 8.)
|
g = interactive.float("g", description="Gain", min=0., max=20., unit="dB", 8.)
|
||||||
b = bass_boost(frequency=f, gain=g, s)
|
b = bass_boost(frequency=f, gain=g, s)
|
||||||
s = add([s, b])
|
s = add([s, b])
|
||||||
|
|
||||||
|
# Set up interactive control for main volume
|
||||||
a = interactive.float("main_volume", min=0., max=20., 1.)
|
a = interactive.float("main_volume", min=0., max=20., 1.)
|
||||||
s = compress.multiband.interactive(bands=3, s)
|
s = compress.multiband.interactive(bands=3, s)
|
||||||
|
|
||||||
|
# Apply audio processing effects
|
||||||
s = nrj(normalize(s))
|
s = nrj(normalize(s))
|
||||||
s = crossfade(fade_out=3., fade_in=3., duration=5., s)
|
s = crossfade(fade_out=3., fade_in=3., duration=5., s)
|
||||||
s = amplify(a, s)
|
s = amplify(a, s)
|
||||||
|
|
||||||
|
# Skip blank sections in the stream
|
||||||
s = blank.skip(max_blank=2., s)
|
s = blank.skip(max_blank=2., s)
|
||||||
|
|
||||||
|
# Configure logging settings
|
||||||
log_to_stdout = true
|
log_to_stdout = true
|
||||||
log_to_file = true
|
log_to_file = true
|
||||||
logpath = "/home/pi/Conjurer/radio_log.log"
|
logpath = "/home/pi/Conjurer/radio_log.log"
|
||||||
@@ -27,23 +45,27 @@ loglevel = 4
|
|||||||
set("log.stdout", log_to_stdout)
|
set("log.stdout", log_to_stdout)
|
||||||
set("log.level", loglevel)
|
set("log.level", loglevel)
|
||||||
|
|
||||||
# Enable logging to file. See variable: logpath
|
# Enable logging to file
|
||||||
set("log.file", log_to_file)
|
set("log.file", log_to_file)
|
||||||
set("log.file.path", logpath)
|
set("log.file.path", logpath)
|
||||||
|
|
||||||
|
# Set up emergency fallback track
|
||||||
emergency = single("/home/pi/RetroPie/mp3/Youtube/Dr. Peacock - Trip to Ireland [GvrvQTUbUcA].mp3")
|
emergency = single("/home/pi/RetroPie/mp3/Youtube/Dr. Peacock - Trip to Ireland [GvrvQTUbUcA].mp3")
|
||||||
|
|
||||||
|
# Create a fallback stream with the main stream and emergency track
|
||||||
radio = fallback(id="switcher", track_sensitive=false, [s, emergency])
|
radio = fallback(id="switcher", track_sensitive=false, [s, emergency])
|
||||||
|
|
||||||
|
# Handle metadata events
|
||||||
handle_metadata = fun (m) -> begin
|
handle_metadata = fun (m) -> begin
|
||||||
log.info(m["title"])
|
log.info(m["title"])
|
||||||
log.info(m["artist"])
|
log.info(m["artist"])
|
||||||
log.info(m["filename"])
|
log.info(m["filename"])
|
||||||
end
|
end
|
||||||
radio.on_metadata(handle_metadata)
|
radio.on_metadata(handle_metadata)
|
||||||
|
|
||||||
|
# Enable persistent script parameters
|
||||||
interactive.persistent("script.params")
|
interactive.persistent("script.params")
|
||||||
|
|
||||||
|
# Configure output formats and destinations
|
||||||
# Enable logging on Standard Output and set logging level.
|
|
||||||
|
|
||||||
output.file.hls("/tmp/hls", [("mp3-low", %mp3(bitrate=96)), ("mp3-hi", %mp3(bitrate=160))], radio)
|
output.file.hls("/tmp/hls", [("mp3-low", %mp3(bitrate=96)), ("mp3-hi", %mp3(bitrate=160))], radio)
|
||||||
output.icecast(%mp3, host="retropie", port=8000, password=credentials.password, icy_metadata="true", mount="mp3-stream", radio)
|
output.icecast(%mp3, host="retropie", port=8000, password=credentials.password, icy_metadata="true", mount="mp3-stream", radio)
|
||||||
|
|||||||
Reference in New Issue
Block a user