Hi all,
I've put together a little streaming box, the important bit being Error
LEDs light up when no audio is playing or it has switched to a local
fallback source (directory full of mp3s).
This worked fine until I added a fallback of local files and then my
error LEDs never triggered. So I tried to make a fallback transition
that would do the following:
1. Stop playing the dead live stream
2. Call a function that would do some system commands so that the right
LEDs would light up
3. Carry on playing local files
Then do the reverse when the stream came back:
1. Call a function to put LEDs to normal state
2. Switch to live stream (track_sensitive=true)
Much more detail below...
I have functions defined like:
def playbackStopped()
system("/home/thevoiceasia/scripts/sendAudioStopped.sh")
end
I have two sources (one live, one local):
liveStream = (input.http(id="thevoiceasia",HTTPSTREAM):source(2,0,0))
emergency = playlist(DIRECTORY)
Then I have an output straight to ALSA:
output.alsa(fallible=true,on_start=playbackStarted,on_stop=playbackStopped,liveStream)
This worked fine, red or green LEDs lit as expected.
So I tried adding the fallback:
liveStream = fallback(track_sensitive=true,[liveStream,emergency])
But the error lights never turn on (because audio is always playing).
So I googled a lot and found someone
(http://sourceforge.net/p/savonet/mailman/message/21412775/) explaining
defining a custom transition which confused me but I ended up with
another function and an altered liveStream:
def fallbackActive(a,b)
system("/home/thevoiceasia/scripts/sendFallbackActive.sh")
sequence([a,b])
end
liveStream =
fallback(track_sensitive=false,transitions=[fallbackActive,fallbackActive],[liveStream,emergency])
The error led does come on but it never goes off as on_start is never
called. So I added another fallbackInActive (the reverse light
sequence) but now I've lost the error led again.
Can anyone point out where I've screwed up?
Cheers,
--
Wayne Merricks
The Voice Asia
------------------------------------------------------------------------------
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users