mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Fix
This commit is contained in:
@@ -9,6 +9,7 @@ let json.parse credentials = file.contents("/home/pi/Conjurer/icecast_credentia
|
||||
enable_replaygain_metadata()
|
||||
|
||||
# Set up a playlog for tracking played tracks
|
||||
|
||||
l = playlog(duration = 72000.0, persistency="/home/pi/Conjurer/persistence.log")
|
||||
|
||||
# Function to check if a track can be played based on its metadata
|
||||
@@ -52,7 +53,7 @@ jingles = (playlist(reload_mode="watch", "/home/pi/Conjurer/jingles.playlist"))
|
||||
# Create the main stream with random playlist and jingles
|
||||
s = rotate(id="randomizer", weights=[10, 1], [s4, jingles])
|
||||
|
||||
s = crossfade(fade_out=3., fade_in=3., duration=5., fallback(id="switcher", track_sensitive=false, [requests_queue, s]))
|
||||
s = crossfade(fade_out=2., fade_in=2., duration=4., fallback(id="switcher", track_sensitive=false, [requests_queue, s]))
|
||||
|
||||
# Set up an interactive harbor for controlling the stream
|
||||
interactive.harbor(port = 9999)
|
||||
@@ -71,7 +72,7 @@ s = compress.multiband.interactive(bands=7, s)
|
||||
s = nrj(normalize(s))
|
||||
s = amplify(a, s)
|
||||
|
||||
mic = buffer(input.alsa()) # Microphone
|
||||
mic = buffer(input.pulseaudio()) # Microphone
|
||||
mic = gate(threshold=-30., range=-80., mic)
|
||||
mic = blank.strip(max_blank=2., min_noise=.1, threshold=-20., mic)
|
||||
|
||||
@@ -111,19 +112,12 @@ def check_skip()
|
||||
end
|
||||
|
||||
# Run the queue processing function every 60 seconds
|
||||
thread.run(every=5., queue_processing)
|
||||
thread.run(every=60., queue_processing)
|
||||
|
||||
|
||||
# Run the check_skip function every 5 seconds
|
||||
thread.run(every=5., check_skip)
|
||||
thread.run(every=15., check_skip)
|
||||
|
||||
# Handle metadata events
|
||||
handle_metadata = fun (m) -> begin
|
||||
log.info(m["title"])
|
||||
log.info(m["artist"])
|
||||
log.info(m["filename"])
|
||||
end
|
||||
radio.on_metadata(handle_metadata)
|
||||
|
||||
# Enable persistent script parameters
|
||||
interactive.persistent("script.params")
|
||||
|
||||
Reference in New Issue
Block a user