Hello Everyone,

Sorry for re-bothering you with this,

But I'm still stuck at the problem I described a few months ago.

Back then, I've been trying to set up a "song counter"

(which would enable me to switch the source to unavailable after having played like 15 items from playlist / source).

But whatever I tried, I could not get a simple thing like

songsplayed = songsplayed+1


to work.


Now, I just discovered that in latest LiquidSoap, there is the "time" function, which I think might do the trick just fine.


However, I don't get this one to work either.

Could someone try helping me out once more?


What I try to do:

As soon as my live source goes offline, music should be played for about 15 minutes.

After 15 minutes, the "music" should become unavailable and instead, a single file should be played (telling the listeners that no broadcast is going on).


What I get:

Currently, the line {time - musictime < 300} results in:

this value (referring to: musictime) has type
()->float

but it should be a subtype of
something that is a number type

These are the important lines:

#The stream should start with music

musictime = time


#Transition to live source

def GoLive (old, new) =

source.skip(old)

sequence([old,new])

end


#Transition away from live


def ComeHome(old,new) =

musictime = time

sequence(old,, new)

end


#The soures

offairloop = mksave(playlist("/home/pi/radio/loop"))

themusic = playlist("/mnt/storage/radio/music")


#The switch, where the magic is supposed to happen

nonliveradio = switch (track_sensitive = true, [

({time - musictime < 300}, themusic),

({true}, offairloop)

])


#Later, I'll add the live source, and do a fallback: When live goes off, switch to nonliveradio...

#But that I think is not important just yet :-(


So once more, I'd appreciate any pointers.

Thanks so much!
And best regards,
René



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to