-1

I am using liquidspoap for a community radio station. when silence is detected, liquidsoap starts playing a playlist.

My issue is that, if liquid soap detects silence then it starts the backup pls, then goes back to normal once sound comes back, then the next time it detects silence, it plays the backup playlist, but this time it continues playing from where it was left last time. I just want the playlist to play from the beginning each time? any ideas please, my script is below

#!/home/ubuntu/.opam/system/bin/liquidsoap

set("log.file",false)

set("log.stdout",true)

set("log.level",3)

# myplaylist

myplaylist = playlist("~/backup_playlist/playlist/Emergency-list.m3u",mode="normal")    

backup_playlist = audio_to_stereo(myplaylist)

blank = once(single("~/blank_7_s.mp3"))

#Live local talk stream

live_local = input.http("http://test.com:8382/main.mp3")

#Live remote talk stream

live_remote=input.harbor("live_remote",port=8383,password="test",buffer=2.0)

# Talk over stream using microphone mount.

mic=input.harbor("mic",port=8383,password="test",buffer=2.0)

# If something goes wrong, we'll play this

security = single("~/backup_playlist/test.mp3")

radio = fallback(track_sensitive=false, [strip_blank(max_blank=120.,live_remote), strip_blank(max_blank=120.,live_local), backup_playlist , security])

radio = smooth_add(delay=0.65, p=0.15, normal=radio, special=strip_blank(max_blank=2.,mic))

# Stream it out

output.icecast(%mp3(bitrate=64), host="localhost", port=8382, password="test", mount="listen.mp3", genre="Talk", description="test Station Australia",  $
Ossama
  • 2,401
  • 7
  • 46
  • 83

1 Answers1

-1

If you do not need to have a playlist, an easy way would be to have an array of songs, and when you fallback, you just pick a random song from that array and it will start from the beginning. Note, I do not know how to do this or if it would work, as I am not familiar with liquidsoap, and this is more of a workaround than a solution. I will work on finding a better solution, but I hope this helps for now!

Beckett O'Brien
  • 176
  • 2
  • 16
  • thanks, but if you are not familiar with liquid soap how good is your help, i do appreciate your time in taking to help. – Ossama Jun 05 '19 at 08:01