我正在将LiquidSpoap用于社区广播电台。当检测到沉默时,LiquidSoap开始播放播放列表。
我的问题是,如果液体肥皂检测到静音,那么它开始备份PL,然后一旦声音恢复了,然后下次检测到沉默时,它会播放备用播放列表,但是这次它继续播放从上次留下来的地方。我只希望播放列表每次从一开始播放?请任何想法,我的脚本在下面
#!/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", $
如果您不需要播放列表,那么一种简单的方法就是拥有一系列歌曲,而当您退缩时,您只需从该数组中选择一首随机歌曲,它将从头开始。请注意,我不知道该怎么做或是否有效,因为我对LiquidSoap不熟悉,这比解决方案更像是解决方法。我将努力找到一个更好的解决方案,但希望现在有帮助!