Hi Sam-

Yes, it is definitely a job for fallback, but I am having trouble getting
the effect I want.  See code below.

What I want is something like the uncommented fallback line in this code
but for neither input to take priority - that is, I want to put on the
output the first input that is not silent, wait until it has silence, and
then select the next input (1 or 2) to break silence.

Hope this is more clear.

Dave


#/usr/bin/liquidsoap

# Feed 1
url1 = "http://somehost.com:8000/mount1";
input1 = mksafe(input.http(id="mount1",url1))
input1 = skip_blank(input1)

# Feed 2
url2 = "http://somehost.com:8000/mount2";
input2 = mksafe(input.http(id="mount2",url2))

# Two tests:
#
# this one will only stream the first one to not have silence but will
never fallback to the other
#s = fallback(track_sensitive=false, [ input1, input2 ])

# this one will switch output between input1 and input2 but when input2 is
not silent it takes priority
# over input1 - when input2 is silent input1 is on the output
s = fallback(track_sensitive=true, [ strip_blank(input2, max_blank=3.),
input1 ])

output.icecast(%mp3(samplerate=11025, bitrate=16, stereo=false),host="
somehost.com",port=8000,password="xxxxx", mount="scan_test",
icy_metadata="true", url="http://somehost.com";, name="Feed Scan",
description="Feed Scan", fallible=true, s)


On Thu, May 23, 2013 at 12:22 PM, Samuel Mimram <[email protected]> wrote:

> Hi,
>
> I am not sure to understand exactly what you are trying to do, but
> isn't precisely the "fallback" operator doing what you need? It takes
> a list of sources as argument and plays the first available one!
>
> ++
>
> Sam.
>
> On Wed, May 22, 2013 at 6:03 PM, Dave Pascoe <[email protected]> wrote:
> > I am trying to do the following:
> >
> > - Connect to anywhere from 2 to n stream sources (all mono), where n can
> be
> > 2-5 or more
> > - Play the first stream that does not have silence (to a mono stream
> output)
> > then go back to monitoring all streams for "no silence" - then the next
> > stream to have "no silence" gets played to the output, and so on
> >
> > Anyone have any ideas on how I might structure this?  I have been a
> little
> > out of touch with recent function development - I am running Liquidsoap
> > 1.0.1 (Liquidsoap 1.0.1+scm
> > (git://
> github.com/savonet/liquidsoap.git@addd3a23e32149c1869ff078a1d3b5c30d0d5081:20130208:092038
> ))
> >
> >
> > but, if needed, I can update to any newer version if need be.
> >
> > Any ideas/thoughts appreciated.
> >
> > Dave
> >
> >
> >
> ------------------------------------------------------------------------------
> > Try New Relic Now & We'll Send You this Cool Shirt
> > New Relic is the only SaaS-based application performance monitoring
> service
> > that delivers powerful full stack analytics. Optimize and monitor your
> > browser, app, & servers with just a few lines of code. Try New Relic
> > and get this awesome Nerd Life shirt!
> http://p.sf.net/sfu/newrelic_d2d_may
> > _______________________________________________
> > Savonet-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/savonet-users
> >
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to