Mix a live stream with a playlist #2118
Replies: 1 comment
-
Heh, I keep starting and re-starting this reply because I keep thinking of new things. If you want the volume of the livestream to go to zero -- that is the ads completely take over and you can't hear the livestream at all -- you could use fallback with track_sensitive set to false so the ads will take over from the livestream. If you want your ads to play at the top of the hour, this might work (but no guarantees):
Okay, so the fallback statement will pre-empt the livestream as soon as "adswitch" becomes available, then go back to the livestream when "adswitch" is no longer available. That makes the livestream volume effectively go to zero when the ads are playing. Now adswitch becomes available for 10 minutes at the top of the hour but the delay statement keeps it from being available for 15 minutes (900 seconds) after it has played. At the top of the hour, an ad should play and then not be available again for 15 minutes. By that time the switch statement will be false and the ads will wait until the top of the hour again. Make sure that the switch window is longer than the longest ad you want to play, otherwise it will close while the ad is playing and go back to the livestream early. And the delay time should be longer than the switch window. This is all theoretical, I haven't tested this exact code. But I use a similar method to fire off a single long-form mix from a playlist and only play one regardless of how long it is (they are anywhere from 30 minutes to 1h20). Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
The question is more or less as in
#1807
i.e.
radio = add([livestream, switch([({0m0s},ads)])])
where the volume of the livestream goes to zero when the ads are enabled by the predicate,
and go back to normal when the ads stop.
The discussion 1807 shows a solution based on the blank.strip of the livestream,
and I searching around haven't found others ideas.
Perhaps two or more collaborating instances of liquidsoap could be better that a single instance , or perhaps
just using the threads of a single instance can be enough.
Beta Was this translation helpful? Give feedback.
All reactions