#!/usr/local/bin/liquidsoap set("log.file.path","/tmp/test.log") #set("init.daemon",true) #set("init.daemon.pidfile",false) # функция кроссфейда, здесь желательно ни чего не менять def crossfade(~start_next,~fade_in,~fade_out,s) s = fade.in(duration=fade_in,s) s = fade.out(duration=fade_out,s) fader = fun (a,b) -> add(normalize=false,[b,a]) cross(duration=start_next,fader,s) end # telnet server для использования liGUIdsoap set("server.telnet", true) #дневной плейлист day = playlist(reload=600,"/var/www/metra52/data/www/onlydc.ru/music/day.txt") #ночной night = playlist(reload=600,"/var/www/metra52/data/www/onlydc.ru/music/night.txt") #Джинглы jingles = playlist(reload=600,"/var/www/metra52/data/www/onlydc.ru/music/jingles.txt") myplay = switch([({ 3h-23h }, day), ({ 23h-3h }, night)]) def smooth_add(~delay=0.5,~p=0.2,~normal,~special) d = delay fade.final = fade.final(duration=d*2.) fade.initial = fade.initial(duration=d*2.) q = 1. - p c = amplify fallback(track_sensitive=false, [special,normal], transitions=[ fun(normal,special)-> add(normalize=false, [c(p,normal), c(q,fade.final(type="sin",normal)), sequence([blank(duration=d),c(q,special)])]), fun(special,normal)-> add(normalize=false, [c(p,normal), c(q,fade.initial(type="sin",normal))]) ]) end #построение плейлиста с кроссфейдом #fade_out - затухание предыдущей песни в сек #fade_in - нарастание следующей песни в сек radio = mksafe(crossfade(start_next=1.,fade_out=7.,fade_in=7.,myplay)) radio = smooth_add(normal=radio,special=switch([({ 20m0s or 50m0s }, jingles)])) #radio = random(weights = [1, 4],[jingles, myplay]) #запускаем вещалку output.icecast(%mp3(bitrate=128), host = "localhost", port = 9000, password = "****", mount = "test",name="OnLY DanCe Radio ~ RJ^NOED ~net", description="Club Music For LIVE", genre="Club House",url="http://onlydc.ru",radio)
2011/03/15 19:14:45 >>> LOG START 2011/03/15 19:14:44 [protocols.external:3] Didn't find "ufetch". 2011/03/15 19:14:44 [protocols.external:3] Found "/usr/bin/wget". 2011/03/15 19:14:45 [main:3] Liquidsoap 1.0.0-beta+svn (trunk/liquidsoap@rev8237) 2011/03/15 19:14:45 [main:3] Using: pcre=5.13.0 dtools=0.2.2 duppy=0.4.0 0.4.0 duppy.syntax=0.4.0 0.4.0 cry=0.1.6 mm=0.1.0 mad=0.4.0 flac=0.1.0 lame=0.2.4 ao=0.2.0 samplerate=0.1.1 taglib=0.1.4 faad=0.2.0 soundtouch=0.1.6 pulseaudio=0.1.1 ladspa=0.1.2 2011/03/15 19:14:45 [main:2] 2011/03/15 19:14:45 [main:2] DISCLAIMER: This version of Liquidsoap has been 2011/03/15 19:14:45 [main:2] compiled from a snapshot of the development code. 2011/03/15 19:14:45 [main:2] As such, it should not be used in production 2011/03/15 19:14:45 [main:2] unless you know what you are doing! 2011/03/15 19:14:45 [main:2] 2011/03/15 19:14:45 [main:2] We are, however, very interested in any feedback 2011/03/15 19:14:45 [main:2] about our development code and committed to fix 2011/03/15 19:14:45 [main:2] issues as soon as possible. 2011/03/15 19:14:45 [main:2] 2011/03/15 19:14:45 [main:2] If you are interested in collaborating to 2011/03/15 19:14:45 [main:2] the development of Liquidsoap, feel free to 2011/03/15 19:14:45 [main:2] drop us a mail at <savonet-devl@lists.sf.net> 2011/03/15 19:14:45 [main:2] or to join the #savonet IRC channel on Freenode. 2011/03/15 19:14:45 [main:2] 2011/03/15 19:14:45 [main:2] Please send any bug report or feature request 2011/03/15 19:14:45 [main:2] using our trac <http://savonet.rastageeks.org>. 2011/03/15 19:14:45 [main:2] 2011/03/15 19:14:45 [main:2] We hope you enjoy this snapshot build of Liquidsoap! 2011/03/15 19:14:45 [main:2] 2011/03/15 19:14:45 [lang:3] Did not find flac binary: flac decoder disabled. 2011/03/15 19:14:45 [lang:3] Did not find metaflac binary: flac metadata resolver disabled. 2011/03/15 19:14:45 [lang:3] Did not find faad binary: faad decoder disabled. 2011/03/15 19:14:45 [lang:3] Lastfm/audioscrobbler support was not compiled. 2011/03/15 19:14:45 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master. 2011/03/15 19:14:45 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples. 2011/03/15 19:14:45 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks. 2011/03/15 19:14:45 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks. 2011/03/15 19:14:45 [threads:3] Created thread "generic queue #1". 2011/03/15 19:14:45 [threads:3] Created thread "non-blocking queue #1". 2011/03/15 19:14:45 [djingls:3] Loading playlist... 2011/03/15 19:14:45 [djingls:3] Playlist is a directory. 2011/03/15 19:14:45 [djingls:3] Successfully loaded a playlist of 6 tracks. 2011/03/15 19:14:45 [day(dot)txt:3] Loading playlist... 2011/03/15 19:14:45 [day(dot)txt:3] No mime type specified, trying autodetection. 2011/03/15 19:14:45 [day(dot)txt:3] Playlist treated as format audio/mpegurl 2011/03/15 19:14:45 [day(dot)txt:3] Successfully loaded a playlist of 833 tracks. 2011/03/15 19:14:45 [Hard\ House:3] Loading playlist... 2011/03/15 19:14:45 [request:3] Nonexistent file or ill-formed URI "/var/www/metra52/data/www/onlydc.ru/music/Hard\\ House"! 2011/03/15 19:14:45 [Hard\ House:2] Failed when resolving playlist URI "/var/www/metra52/data/www/onlydc.ru/music/Hard\\ House"! 2011/03/15 19:14:45 [Hard\ House:3] Got an empty list: keeping the old one. 2011/03/15 19:14:45 [non-stop:3] Connecting mount non-stop for source@localhost... 2011/03/15 19:14:45 [decoder:3] Method "MP3/LIBMAD" accepted "/var/www/metra52/data/www/onlydc.ru/music/House/Incognet Tribute (Original Mix).mp3". 2011/03/15 19:14:45 [decoder:3] Method "MP3/LIBMAD" accepted "/var/www/metra52/data/www/onlydc.ru/music/djingls/AntonSound@ya.ru - Only Dance Radio 2.mp3". 2011/03/15 19:14:45 [non-stop:3] Connection setup was successful. 2011/03/15 19:14:45 [threads:3] Created thread "wallclock_main" (1 total). 2011/03/15 19:14:45 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock. 2011/03/15 19:14:45 [fallback_4400:3] Switch to mksafe. 2011/03/15 19:14:45 [mksafe:3] Switch to safe_blank.
#!/usr/local/bin/liquidsoap set("log.file.path","/tmp/nonstop.log") set("init.daemon",true) set("init.daemon.pidfile",false) # telnet server для использования liGUIdsoap set("server.telnet", true) # функция кроссфейда, здесь желательно ни чего не менять def crossfade(~start_next,~fade_in,~fade_out,s) s = fade.in(duration=fade_in,s) s = fade.out(duration=fade_out,s) fader = fun (a,b) -> add(normalize=false,[b,a]) cross(duration=start_next,fader,s) end #дневной плейлист day = out(playlist("/var/www/metra52/data/www/onlydc.ru/music/day.txt")) #ночной night = out(playlist("/var/www/metra52/data/www/onlydc.ru/music/night.txt")) #Джинглы jingles = out(playlist("/var/www/metra52/data/www/onlydc.ru/music/jingls.txt")) myplay = switch([({ 3h-23h }, day),({ 23h-3h }, night)]) def smooth_add(~delay=0.5,~p=0.2,~normal,~special) d = delay fade.final = fade.final(duration=d*2.) fade.initial = fade.initial(duration=d*2.) q = 1. - p c = amplify fallback(track_sensitive=false, [special,normal], transitions=[ fun(normal,special)-> add(normalize=false, [c(p,normal), c(q,fade.final(type="sin",normal)), sequence([blank(duration=d),c(q,special)])]), fun(special,normal)-> add(normalize=false, [c(p,normal), c(q,fade.initial(type="sin",normal))]) ]) end #построение плейлиста с кроссфейдом #fade_out - затухание предыдущей песни в сек #fade_in - нарастание следующей песни в сек radioq = mksafe(crossfade(start_next=1.,fade_out=7.,fade_in=7.,myplay)) radio = smooth_add(normal=radioq,special=switch([({ 20m0s or 50m0s }, jingles)])) #radio = random(weights = [1, 4],[jingles, myplay]) #запускаем вещалку #output.icecast(%mp3, # host = "localhost", port = 9000, # password = "****", mount = "non-stop",name="OnLY DanCe Radio ~ RJ^NOED ~net", description="Club Music For LIVE", genre="Club House",url="http://onlydc.ru",radio) output.icecast(%mp3, host = "localhost", port = 9000, password = "***", mount = "test",name="OnLY DanCe Radio ~ RJ^NOED ~net", description="Club Music For LIVE", genre="Club House",url="http://onlydc.ru",radio)