2011/7/27 Jean-Noel <[email protected]>:
> Hi David.
Hi !
> I need to configure a track-sensisitve switch to add jingles.
> I wish that jingles wait for the end of the current track. How can I do ?
> My script is :
>
> radio = add([radio, switch([({10m0s},jingles)])])
>
> Where do I insert the "track_sensitive=true" please ?
You are using the wrong operator.. You should use a fallback of a
switch instead..
Also, if you want to make sure that the jingle is played at the 10th
minute of each hour, as you wrote above, you should use a more relaxed
predicate: 10m0s really means that the source will be available only
at precisely 10 minutes and 0 seconds of each hour..
Thus, you need to make your time predicate more relaxed but also make
sure that you wont have two jingles in a row.. For this, you would use
the delay operator, which ensures that a source cannot play a new song
after the current one for a duration that you set.
Thus, if for instance, your songs are less than 2 minutes, you could
do something like:
radio =
fallback( [
radio,
switch( [ ( 9m-11m, delay( 120., jingles)) ] )
] )
In this case, the jingles source will be available from 9m to 11m
every hour. It seems likely that any song will end during that slot.
Then one jingle will be played and the delay operator will prevent any
other to be played for the next 2 min. However, after two minutes.
when delay allows a new jingle, the time predicate 9m-11m will be over
so you make sure that no two jingles can be played in a row..
As you can see, this is not really good.. If you really want to keep
the end of your songs, then you should probably change your
requirements so that jingles are played not in absolute time but in
relative time -- for instance every 3 songs, using the rotate
operator.
If you really want your jingles at a precise time, then it would be
better to allow to cut a song. In this case, you could think of using
the transition parameter of fallback and swtich operators in order to
assure a smooth transition..
Finally, for a more finer-grained control of the scheduling, you could
consider moving to request.dynamic and/or request.push, which would
allow to control the schedulign of tracks and jingles form outside of
liquidsoap, for instance an interface of yours..
Good luck and all the best!
Romain
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users