Le 26 juillet 2011 20:11, Shane Jonet <[email protected]> a écrit :
> Hi all,
Hi!
> Our online radio station is becoming more accustomed to Liquidsoap,
Excellent!
> and
> we're wondering if we can go about some more advanced tasks now.
Please do :-)
> We've got
> the following questions:
>
>
> 1. If a harbor has an active connection, but is buffering, for instance, we
> want to fill in that buffer time with something other than our normal fall
> back. That buffer time could be filled with silence, for example, but we
> *do not* want to fall back to our normal music. Is there something akin to
> 'fallback-on-break-in-input' or something of the like?
Hmm.. Have you looked at the on_connect callback parameter of
input.harbor? I believe that this callback is executed when the source
client connects, hence before buffering starts. Using this callback,
you should be able to do whatever you think is appropriate while the
harbor is buffering..
> 2. How do we terminate a stream that we began with input.harbor?
It depends. If you mean kicking out the current source client, you use
id.kick/id.stop (they are the same) as a server/telnet commands. If
you mean getting rid of the whole input.harbor source then you use
source.shutdown.
> 3. How do we terminate a stream that we began with input.http?
Same as above (except that the command should be id.stop)
> 4. Is it possible to end a harbor input's stream after a specific duration?
Yes! The simpliest way I see now is, again, to use on_connect and
register a function to be executed later using add_timeout. That way,
you can program the end of the current streaming after the timeout has
expired, when the function is executed.
If you want to do it when the source actually starts playing (i.e.
when buffering is done) then you could look at attaching an
output.dummy to the source and using its on_start callback.
> 5. Is it possible to end a harbor input's stream at a specific time?
This can be more tricky. I don't think we currently have any specific
operator to execute something at a specific time. However, you can
either do it externaly and use the telnet server or register a
recurrent add_timeout function which will fire off when the time has
come..
> 6. Is it possible to use source.seek from Telnet?
Sure! You need to register the command manually though. Something like this:
def f(t) =
t = float_of_string(t)
log("Seeking #{t} seconds.")
ret = source.seek(s,t)
log("Seeked #{ret} seconds.")
"Done!"
end
server.register("seek",f)
> 7. While in a rotate block, is is possible to move to a specific weighted
> item inside of a rotate cycle, such as the second track from the third
> segment of the rotate block?
Hmmm.. I'm not sure I understand this but I'm also not sure it is possible :)
What you can try to do is to use request.equeue/queue as sources in
the rotate block and move their requests from one source to
another....
> 8. Can the above be done from from Telnet?
Basically, everything that you can do within the script can be
exported to telnet using server.register. The converse is
unfortunately not true as of now: some operations are only availabe
through telnet and may be executed from within a script only using
server.execute, which is a embarassing hack :)
Hope this helps,
Romain
------------------------------------------------------------------------------
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