From 1cbd44c3330d11a1e9489300766d9ef1d37e9cb7 Mon Sep 17 00:00:00 2001 From: Migatu Date: Mon, 29 Apr 2024 21:07:30 +0200 Subject: [PATCH] Fix --- conjurer_musician/radio_conjurer.liq | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/conjurer_musician/radio_conjurer.liq b/conjurer_musician/radio_conjurer.liq index bd98ea0..bd36cc9 100644 --- a/conjurer_musician/radio_conjurer.liq +++ b/conjurer_musician/radio_conjurer.liq @@ -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")