hi could I see a code example of how this is done as I'm not sure what
the (relay source) and the (live source) stuff with the dots is unless
that is filler where the code should go?
I've got a little less than 2 weeks to get this working.
Help?
Thanks.
I'll reattach my scripts.
Original message:
Hi Joey!
2012/1/11 Joey Weston <[email protected]>:
Hi attached are my 3 scripts.
What I want to do is instead of restarting the main crosswavesradio.liq
running liquidsoap I want to combine the relay with the show functionality
so that when a live show starts the relay audio is overriden so I don't have
to keep killing the relay.liq instance of liquidsoap just to go live.
What you need is a fallback :-)
A fallback plays from the first source available in a list of sources.
Here, you want to play live source if it is available, or play relayed
stuff otherwise. Here's how to do it:
live = (... live source ...)
relay = (... relay source ...)
# Combine the two, play live over relay whenever available
radio = fallback( track_sensitive=false, [live, relay] )
Note the use of "track_sensitive=false" above: by default, the
fallback may changes its source only at the end of a track. Here, we
clearly want the live to start as soon as it is ready!
For further evolved use of fallback, I'd recommend browsing through
the online doc. Two points that you may want to read about are:
* Custom transitions when switching back and forth. For instance add
a jingle etc..
* Skip relay's current song when switching to the live source, so
that it restarts with a fresh title when lives goes out. For this one,
you may want to look at the code for the fallback.skip operator, which
is defined in utils.liq (liquidsoap/scripts/utils.liq)
Romain
--
Email services provided by the System Access Mobile Network. Visit
www.serotek.com to learn more about accessibility anywhere.
set("server.telnet", true)
set("harbor.password", "Juliette77Wisky")
root="/home/crosswavesradio/"
def show (id, password, name)
archive_filename="#{root}archives.crosswavesradio.com/#{id}/%Y-%m-%d.mp3"
#def live_start
# system( "/home/crosswavesradio/relay start &" )
#end
#def live_stop
# system( "/home/crosswavesradio/relay stop &" )
#end
live=input.harbor (port=8001, password=password, id)
output.file (fallible=true, reopen_delay=5., %mp3, archive_filename,
append=true, live)
#live = input.harbor( on_connect = live_start, on_disconnect = live_stop)
live
end
def fade (~fade_in=0.1, ~fade_out=0.1, ~fade_duration=0.1,
a,b)
add (normalize = false,
[ sequence([ blank(duration=fade_duration-fade_in),
fade.initial(duration=fade_in,b) ]),
fade.final(duration=fade_out,a) ])
end
%include "shows.liq"
music = playlist(reload=3600, "#{root}auto/fallback")
id=playlist (reload=3600, "#{root}id")
id=delay (1200., id)
#requests=request.queue(id="requests")
stream = rotate(transitions = [fun(a,b)->b, fade], [id, music])
#stream=fallback ([requests, stream])
stream=fallback (track_sensitive=false, [shows, stream])
stream=mksafe(stream)
output.icecast (mount="live", name="Crosswaves Radio",
url="http://crosswavesradio.com",
password="Juliette77Wisky", %mp3, stream)
# Input the stream,
# from an Icecast server or any other source
url = "http://68.168.103.13:8337/"
input = mksafe(input.http(url))
output.icecast(
%mp3(bitrate=128),
mount="/auto",
host="173.236.244.233", port=8001, password="auto0",
input)
#shows=switch
#root="/home/crosswavesradio/"
#def show (id, password, name)
#archive_filename="#{root}archives.crosswavesradio.com/#{id}/%Y-%m-%d.mp3"
#live=input.harbor (port=8001, password=password, id)
#output.file (fallible=true, reopen_delay=5., %mp3, archive_filename,
#append=true, live)
#live
#end
#%include "shows2.liq"
shows = switch ([
({false}, show("testing", "Testing123", "Test Stream")),
({true}, show("live", "Live8", "Live Stream")),
({true}, show("auto", "auto0", "Auto DJ")),
({true}, show("carnival", "carnival1", "Tracy's Carnival of
Music")),
({true}, show ("musicoftherisenson", "musicoftherisenson1",
"Music of the Risen Son")),
({true}, show("truckstop", "truckstop1", "The Truckstop with
JackKnife Hayes")),
({true}, show("anythinggoes", "anythinggoes1", "Anything Goes
with Doug and Melissa"))
])
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users