-1

我正在为社区广播电台使用liquidspoap。当检测到静音时,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",  $
4

1 回答 1

-1

如果您不需要播放列表,一个简单的方法是拥有一组歌曲,当您回退时,您只需从该数组中选择一首随机歌曲,它将从头开始。请注意,我不知道如何做到这一点,或者它是否会起作用,因为我不熟悉液体肥皂,这更像是一种解决方法而不是解决方案。我将努力寻找更好的解决方案,但我希望这对现在有所帮助!

于 2019-06-04T02:14:08.657 回答