Usare liquidsoap per stremmare 24/24. Versione consigliata liquidsoap-3.8.1 Riferimento originale: [[http://savonet.sourceforge.net/]] Documentazione: [[http://savonet.sourceforge.net/doc-0.3.8/documentation.html]] Riferimenti API: [[http://savonet.sourceforge.net/doc-0.3.8/reference.html]] Stralci, esempi e scripts: [[http://savonet.sourceforge.net/doc-0.3.8/scripts/index.html]] Codice per radio cybernet: -------- {{{ #!/opt/liquidsoap/bin/liquidsoap # sockets and streaming accounts setup %include "~/soap/scripts/radio_cybernet/server.liq" %include "~/soap/scripts/radio_cybernet/log.liq" # this is to reload any playlists every hour and every quarter hour = playlist(reload=3600) quarter = playlist(reload=900) # playlists files, also works with /path/to/directory/withaudiofiles/ # but somehow take more memory # reload them any -tot- # there is cronjob that regenerate the playlists based on directories # any 15 minutes jingle = mksafe(hour("/home/radio/soap/playlists/jingles.pls")) listall = quarter("/home/radio/soap/playlists/globale.pls") # live istance to be picked. live = "http://radio.dyne.org:8000/rcyb_live.mp3" # every 5 tracks play one jingle radio = random(weights=[1,5],[ jingle, listall ]) # server definition, definition can be nested, in fact the set to the icacasr server uri is afterwards mp3 = output.icecast.mp3(restart=true, restart_delay=5, port=8000, user="source", password="xxx", genre="Experimental,Eclectic,Free pirate radio", url="http://radiocybernet.org/", description="Online since 1997", public=true, samplerate=22050, bitrate=24, stereo=false) ogg = output.icecast.vorbis(restart=true, restart_delay=5, port=8000, user="source", password="xxx", genre="Experimental,Eclectic,Free pirate radio", url="http://radiocybernet.org/", description="Online since 1997", public=true, samplerate=22050, stereo=false) # define an event, if event appears relay the live # there is a hack here, older version say_metadata with text2speech worked at end of track # this has never worked # need to be refactored for new say_metadata at beginning of track def event(c,d) def add_metadata(id,s) p = 'say:$(if $(description),"Radio cybernet online since 19 97 $(description)$(if $(genre),\", $(genre)\").")' s = on_track(fun (m) -> ignore(execute("#{id}.push #{p % m}")), s) smooth_add(delay=5.,normal=s,special=request.queue(id=id)) end fallback(track_sensitive=false,[add_metadata("live",input.http(c)),d]) end # crossfade example def crossfade(a,b) add(normalize=false,[ sequence([ blank(duration=5.),fade.initial(duration=10.,b) ]),fade.final(duration=10.,a) ]) end # use event to start the live watch,relay. Again, if no live is there then run the normal radio schedule broadcast = event(live,radio) # nesting variables dyne="radio.dyne.org" # nesting definition, see above mp3dyne = mp3(host=dyne, user="source", password="xxx", mount="rcyb.mp3", name="rcyb.mp3", broadcast ) oggdyne = ogg(host=dyne, user="source", password="xxx", mount="rcyb.ogg", name="rcyb.ogg", broadcast ) }}} --------