Hi Jorge,

I may be rephrasing what Romain said, but here are my answers...

1) My interlude simply does not work, if the user is listening and i kill the 
mount point, the user is disconnected after some seconds without interlude 
song. What is wrong in the code?

Liquidsoap does only one thing: output audio streams. And it does not
know anything about stream listeners connected to icecast. If you kill
the mount point, it just stops liquidsoap's streaming: nothing is
emitted, neither interlude nor anything else. The fallback() operator
deals with failures from the input, i.e. from its children sources.
Like all operators in liquidsoap (except ouputs, somehow) it does not
know anything about what's happening to its output.

The interlude in our scripts was meant for being sent to the output
(i.e. to icecast mount in your example) when an internal source fails.
With a playlilst.safe() it is simply impossible, but some liquidsoap
sources are fallible, like input.http(), or the general playlist(),
and the output will want some way to get data even when they fail.

output(playlist.safe("/PATH/TO/playlist.txt"))
#LOAD SOMETHING IF THE MOUNT FAILS
#interlude = single("/data/streaming/liquidsoap/zoom___soda_stereo.mp3")
#MOVE LISTENNERS TO ANOTHER MOUNT POINT IF THE MAIN FAILS
#src = fallback(tracksensitive=false,[valid_mount_point_name])

A few explanations might be useful here. When you write "src = ..."
you define a new source, named "src", by means of the fallback()
function. If this source is active (i.e. if it's an output then it
will be started), otherwise it can only be used to be directly or
indirectly plugged into an output. In your script you don't do
anything with it, so the last line is completely useless (and
"interlude =.." too).

A more sensible script (which might still not be what you expect) is:
 src = playlist("/PATH/TO/playlist.txt")
 interlude = single("/data/streaming/liquidsoap/zoom___soda_stereo.mp3")
 src2 = fallback(track_sensitive=false,[src,interlude])
 output(src2)

In that script you first create a playlist, and name it "src". This is
no more a playlist.safe(), it's a general playlist which accepts URLs
in the list, and downloads file a bit in advance, and possibly fails
if files are unavailable. So we create the interlude jingle. Then we
create a new source src2 by means of fallback(): it will play src, but
if src fails it will play tracks from interlude. And finally we
output() src2.

The track_sensitive=false means that the tracks from interlude will be
interrupted if src becomes ready again. This is a bit brutal, and we
actually usually use track insensitive fallbacks only when one source
can't wait, like a live show.

In your script I renamed "src" into "src2" to stress that it is
equivalent, it's just a name like an other. And a second definition of
"src" will just mask the other.

2)I cannot run the script with the fallback line, my sintax must have a 
problem, how should i rewrite it ?

As Romain said, the fallback takes a source list as its first
(unlabelled) parameter. Liquidsoap probably didn't complain about the
syntax but about the type of your param (a string instead of a
source). Also, there is an underscore in track_sensitive.

Good luck!
--
David

Reply via email to