Le 19 juillet 2011 23:07, Adrian Owen <[email protected]> a écrit :
> Hi,

Hi!

> I am trying to write a script that will rotate in a static file playback
> instead of a live stream from jack at certain times, and I am stuck.  I just
> havent seemed to have any action occur at the transition times.
> What causes the predicate to be evalled at particular times?  As i
> understand switch it will return the first predicate that evals T ? How can
> this ever leave a live stream, or an infinite playlist for that matter?

The predicate is evaluated quite frequently. For this reason, it
should not be a heavy functions otherwise liquidsoap will get late
evaluating it.

As for leaving, a leave will be done differently depending on the
track_sensitive parameter:
 * if track_sensitive=true, the source will be left when the
predicates evaluates to false and the current track has ended.
 * if track_sensitive=false, the source will be left whenever the
predicate evaluates to false

Indeed, a live stream such as one produced by a jack input does not
have tracks. Thus, you should use track_sensitive=false in the
switches involving such a stream.

Please note, however, that not all live streams do not have tracks.
For instance, with input.http and input.harbor, it is possible to
treat new metadata as new tracks and as such, the live stream will
have tracks.

I am not sure that such a thing is possible with jack inputs as of
now. You may attach metadata to it but there is not generic operator
for adding track marks, either at each metadata or anytime.

However, it should not be too hard to add this functionality, I think,
if there is a need for it.

Romain

> I would appreciate a hand in understanding what i am missing. If i could
> even cause it to print to log an information at transition times I could see
> something happening.
>
> I have included what i am trying to do so far.
>
> Thanks in advance,
>
> Adrian Owen
>
>
> #!/usr/local/bin/liquidsoap
> set("log.file",false)
> set("log.stdout",true)
> set("log.level",5)
> set("server.telnet",true)
> set("server.telnet.bind_addr","127.0.0.1")
> set("root.sync",false)
>
> def jackconnect(m)
>   system('/usr/local/bin/jack_connect system:capture_1 live:in_0')
>   system('/usr/local/bin/jack_connect system:capture_2 live:in_1')
> end
>
> prerec = mksafe(playlist("/home/user/prerec.pls"))
>
> live = input.jack(id="live", buffer_size=2)
>
> radio = insert_metadata(id="meta", live)
> radio = on_track(jackconnect, radio)
>
> radio = fallback([             switch([({ 16h-17h }, prerec),
>                             ({ 22h-6h }, prerec)]),
>                     prerec])
>
> radio = add([radio, switch([({0m30s},live)])])
>
> output.icecast(%external(process="/usr/local/bin/aacplusenc - - 48000 s"),
>   format="audio/aacp",
>   icy_metadata="true",
>   id = "aacplus-1",
>   host = "localhost", port = 1500,
>   password = "hackme", mount = "/testme-48k.aac",
>   url="",
>   description="",
>   genre="",
>   restart=true,
>   restart_delay=1,
>   mksafe (radio))
>
>
>
>
> ------------------------------------------------------------------------------
> Magic Quadrant for Content-Aware Data Loss Prevention
> Research study explores the data loss prevention market. Includes in-depth
> analysis on the changes within the DLP market, and the criteria used to
> evaluate the strengths and weaknesses of these DLP solutions.
> http://www.accelacomm.com/jaw/sfnl/114/51385063/
> _______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
>

------------------------------------------------------------------------------
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