我已经成功地用icecast2设置了liquidsoap,一切都很好在我12.00的配置中;默哀一分钟";和国歌(两者合并为一个文件(问题是,如果歌曲正在播放,而时间切换到12.00,那么icecast正在等待当前歌曲结束,然后播放国歌。问题是,我如何才能在12点准时中断直播和照常播放?
这是我的液皂配置:
#!/root/.opam/default/bin/liquidsoap
set("init.allow_root",true)
out = output.icecast(host = "127.0.0.1",port = 8082,user = "source",password = "passforsource",name = "Streamcast",genre = "Various",url = "https://stackoverflow.com",encoding = "UTF-8")
set("server.telnet.bind_addr","127.0.0.1")
set("server.telnet",true)
dir = "/var/www/html/public/storage/radio"
music_dir = "#{dir}/music"
jingles_dir = "#{dir}/jingles"
set("log.file.path","#{dir}/radio.log")
set("log.level", 3)
jingles = playlist(reload=86400,"#{jingles_dir}")
music = playlist(reload=86400,"#{music_dir}")
national_anthem = single("/var/www/html/public/storage/radio/special-playlists/silence_then_anthem.ogg")
radio = switch([(predicate.activates({ 12h-12h3m }), national_anthem), ({ true }, rotate(weights = [15, 1],[music,jingles]))])
radio = mksafe(radio)
radio = crossfade(smart=true,duration=2.00,fade_out=1.25,fade_in=1.00,radio)
out(
%vorbis.abr(samplerate = 44100, channels = 2, bitrate = 128, max_bitrate = 192, min_bitrate = 96),
description = "Average vorbis 96-128-192 Kbps",
mount = "stream",
mksafe(radio)
)
我写这篇文章的时候太蹩脚了,这里唯一需要做的就是添加"track_sensitive=false";所以最后的代码是:
radio = switch(track_sensitive=false,[(predicate.activates({ 12h-12h3m }), national_anthem), ({ true }, rotate(weights = [15, 1],[music,jingles]))])