Hi Romain! Romain Beauxis wrote: [...] >> expanse = mksafe(switch(track_sensitive = false, [ >> ({ 15m-17m }, commercials), >> ({ 29m-33m }, commercials), >> ({ 40m-42m }, commercials), >> ({ 59m-03m }, commercials), >> ({ 06h00m-18h00m }, stream1), >> ({ 18h00m-06h00m }, stream2), >> ]))
> Just a side-note: you do not need all the mksafe. Only one at the top level > is > sufficient. Right, I just hadn't cleaned that up yet. > Also, if nothing is available, mksafe will stream blank (silence). You may > either want to make your source infallible, by adding a fallback to a single > for instance, or you may also set fallible=true in output.icecast.lame > (liquidsoap 0.9.2 only) so that streaming stops when the source is no longer > available, and restarts when the source is available again.. I won't be using mksafe in production, only for my test environment. >> So that would mean the following: >> >> I would like to create "commercials" as a playlist that is generated >> from a script, and regenerated each time it's queued up to be played. >> The script will be responsible for returning the correct number of MP3s >> to make sure that it fits the 2m or 4m window provided. This particular >> aspect would be very important, since these will change every single >> time they're played. >> >> Obviously "stream1" and "stream2" are just examples, and no stream will >> run for that long (a stream will typically run from 1h to 3h, but is >> subject to change, and ideally I'd be able to change this without >> restarting liquidsoap. This is less important than the dynamic >> commercial generation since it won't change as frequently, and I could >> live with restarting liquidsoap if I had to because my front-end >> Icecast2 server has a fallback so I wouldn't drop listeners. >> >> I'm sure this can all be done, but being new to liquidsoap I'm sure it's >> my limited understanding that's the major stumbling block. Would this >> be a case for request.dynamic()? > > I believe using request.dynamic would make it more flexible for you. However, > using request.dynamic, there can be a delay between the time when the script > is executed and the time when the song starts. > > For liquidsoap 0.9.2, the current behaviour is: > * When there is less than 10 *estimated* seconds remaining, call the script > for a new song > * Use the result of the script to create a new request and try to decode the > file > * Once the decoding is confirmed, queue the file for playing. > > Most of the time, you may expect the song to be played 10s after the script > has been called, but there may be delays is, for instance, the file is big or > else.. > > Also, you can change the 10s using the "length" parameter of the > request.dynamic operator. I have done just that with the following: commercials = request.dynamic(id = "commercials", length = 1., fun() -> request.create(list.hd(get_process_lines("./playnow.sh")))) And it's working well from what I can see. Is it possible for the result of request.dynamic to point to an input.harbor() stream? Let me illustrate: stream1 = input.harbor(...) stream1 = input.harbor(...) final_stream = request.dynamic(id = "final_stream", length = 1., fun() -> request.create(list.hd(get_process_lines("./playnow.sh")))) Where the script "playnow.sh" returns either "stream1" or "stream2"? I would imagine this could be challenging, since there's no way to determine the length and thus no way to determine when to make the next request. It would be nice though, as it would allow me to determine which streams are playing dynamically from an outside script. -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Website : http://www.nickcoons.com | Location : Tempe, AZ USA -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Savonet-users mailing list Savonet-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/savonet-users