我正在为社区广播电台使用液体肥皂。当检测到静音时,liquidsoap开始播放播放列表。
我的问题是,如果液体肥皂检测到静音,则开始备份,然后在声音返回时恢复正常,然后在下次检测到静音时,播放备份播放列表,但是这次继续播放从上次离开的地方开始。我只希望播放列表每次都从头开始播放?有什么想法,我的脚本在下面
#!/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", $
答案 0 :(得分:-1)
如果不需要播放列表,一种简单的方法是拥有一首歌曲,当您回退时,您只需从该阵列中选择一首随机的歌曲,它就会从头开始。请注意,由于我对Liquidsoap并不熟悉,所以我不知道该怎么做或是否可行,这更多的是解决方法,而不是解决方案。我将努力寻找更好的解决方案,但希望目前能对您有所帮助!