Hi,

I'll try to help.

2011/7/27 Radio Mandarine <[email protected]>:
> - fallback to normal jingles at 5, 15, 20, 25, 35, 45 and 55 mn of each
> hour, waiting for the end of the current track to start ;

I'll only discuss this problem, because the other ones are essentially the same.

In your current code you use predicates such as 5m0s, which is only
true at the first second of every minute. Your switch is track
sensitive, which is good because you do not want to interrupt music
tracks, but this also means that the jingle will only play if the
track ends exactly at 5m0s. This is probably not what you want.

You'll be closer to your needs with something like
switch([({5m},jingle),({true},music)]). This allows the jingle to play
anytime during the fifth minute. If a music tracks only ends at 6m,
then you don't get a jingle, and I'll assume that this is okay.

But there is another problem: the jingle source can now play _all the
time_ during 5m, so it'll repeat the jingle.

By the way, I encourage you to try on simple examples, it's easy.
Here's what I tried: I used a single(..) source for jingles. Instead
of a music playlist, I used a source producing short tracks, so that
it necessarily ends some time during the switching predicate:
sine(duration=10.,amplitude=0.3) produces a sine (not too loud thanks
to the amplitude parameter) cut in tracks of 10 seconds. Finally, you
need to change the switching predicate depending on the current time:
$ liquidsoap 'out(switch([({8m},single("<some
mp3>")),({true},sine(duration=10.,amplitude=0.3))]))'

The usual way to fix this is to prevent the jingle operator to play
more than one track per minute, using the delay() operator. For
safety, I'll put two minutes:
switch([({5m},delay(120.,jingle)),({true},music)]).

Getting back to our test example, the following works nicely:
$ liquidsoap 
'out(switch([({9m},delay(120.,single("~/media/audio/jingle/tue-sa-mort-sam.mp3"))),({true},sine(duration=10.,amplitude=0.3))]))'

Hope this helps,
-- 
David

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to