Hello!
Thanks to all the feedback that i have received.
I almost achieve my goal but i think that there is lot of room to
improvement.
I'm still adapting to liquidsoap scripting, so don't laugh about my ugly
code :)
The objective:
Have daily timed jingles, for simplicity lets imagine that are clock
jingles (top of the hour).
I'd like play the jingles at exact hour. And when playing fade out the
current stream/music, and when everything is silence play the jingle and
after the jingle ends fade in the stream/music again.
My progress so far:
- Test 1
jingle = single("/jingles/1.mp3")
radio = add([radio, switch([({01h00m00s},jingle)])])
radio = fallback(track_sensitive = false, [radio, security])
Works great, but it mixes the jingle on top of the music. it seams 50-50
volume. I really like to silence the music completely.
______________________________________________________________________________
- Test 2
jingle = single("/jingles/1.mp3")
timed_promotions = switch([({01h00m00s},jingle)])
radio = fallback(track_sensitive = false, [timed_promotions, radio,
security])
Better, it pauses the music, play the jingle and then play the music
again. almost perfect, i just need some fade in/out in the music to get
smoother experience.
______________________________________________________________________________
- Test 3
def final_fade(a, b) add(normalize = false, [ fade.initial(duration
= 0., b), fade.final(duration = 1., a) ]) end
def out_fade(a, b) add(normalize = false, [ fade.initial(duration =
2., b),fade.out(duration = 0., a) ])end
timed_promotions = switch([({01h00m00s}, single("/jingles/1.mp3") )])
radio =
fallback(track_sensitive=false,[timed_promotions,radio],transitions=[final_fade,out_fade])
This is fading in/out the music, but the jingle dont wait the music to
be fade out/silence. i need something to delay the jingle 2 seconds to
be perfect.
______________________________________________________________________________
- Test 4
def final_fade(a, b) add(normalize = false, [ fade.initial(duration
= 0., b), fade.final(duration = 1., a) ]) end
def out_fade(a, b) add(normalize = false, [ fade.initial(duration =
2., b),fade.out(duration = 0., a) ])end
timed_promotions = switch([({01h00m00s}, sequence(merge=true,[
blank(duration=1.), single("/jingles/1.mp3"),blank(duration=1.)) )])
radio =
fallback(track_sensitive=false,[timed_promotions,radio],transitions=[final_fade,out_fade])
In this one i use blank(duration=1.) before and after the jingle (using
sequence). The final effect is what i was looking for, but as you can
see its a crappy/bugy code.. :)
Also if i repeat that 24 times (24 hours) liquidsoap crashes and/or
underrun. With 4-6 jingles its seems to work but i know that i'm doing
it wrong. :)
I believe i'm missing something, can you help me cooking a decent script? :)
BTW, i'm using 0.9.3
Thanks in advance.
Best Regards,
HR
On 5/19/11 8:20 PM, David Baelde wrote:
Hi Hugo,
A liquidsoap script, once executed, can't be changed without
restarting the whole application. The same holds for %includes, they
are static inclusions that are inlined when executing the script, no
magic there.
Have fun,
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users