No pre-queue when reading for the next audio from an external script #2016
-
I'm studying Liquidsoap to try to replace my current SAM Broadcaster with it. So I'm trying to reproduce the same functioning. My audios come from a PHP script that does all the control logic for jingles, songs, commercials, mixed sets, etc. My script just returns one line, example: /songs/820.mp3 or /jingles/id1.mp3 In LS I'm using "request.dynamic.list" and I managed to get the PHP script file. I recently found out that request.dynamic.list actually adds the "next song" to the queue. Thus, there will always be an audio in the queue. When a file actually plays the PHP execution adds the "next" to the queue, and that causes me problems (ex: a show that needs to start at 08PM exactly). [11-Oct-2021 19:23:34] Generator: /mnt/2869.mp3 <------ request.dynamic.list to queue I found out that there is the parameter "prefetch" in the "request.dynamic.list". Apparently that's what I need, no advanced queue.
It works (I think), but now I don't know how, only on the initial run, add the first audio to the queue :) In SAM, it runs the PHP script when there are 10 seconds left for the current audio to run out. In other words, with 10 seconds left, it runs the script, buffers the next MP3 and fades out (which is never longer than 5 seconds, so it works). Everything is local, so the PHP script returns in milliseconds and is infallible. I wanted to do something similar. Any idea what's the best way to reproduce SAM behavior? Thanks a lot!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
After some hours reading and testing, a found a way to achieve the same functioning. Here is (I'm not sure if the code is well optimized, any tips appreciated).
|
Beta Was this translation helpful? Give feedback.
After some hours reading and testing, a found a way to achieve the same functioning.
Here is (I'm not sure if the code is well optimized, any tips appreciated).