Data radio

From ActiveArchives
Jump to: navigation, search

Liquidsoap script

Final version of the liquidsoap script for data radio

set("log.file.path","/var/www/vhosts/kurenniemi.activearchives.org/dataradio/dataradio.log")
set("init.daemon",true)
set("init.daemon.pidfile.path","/var/www/vhosts/kurenniemi.activearchives.org/dataradio/dataradio.pid")
set("log.stdout",false)
set("log.file",true)
# set("server.telnet",true)
# set("log.stdout",true)
 
scripts = '/var/www/vhosts/kurenniemi.activearchives.org/cgi-bin/dataradio/'
 
brown = single("/var/www/vhosts/kurenniemi.activearchives.org/dataradio/brown.ogg")
 
cassette_extracts = playlist(reload=300, "/var/www/vhosts/kurenniemi.activearchives.org/dataradio/cassette_extracts/")
programs = playlist(reload=300, "/var/www/vhosts/kurenniemi.activearchives.org/httpdocs/dataradio/programs/fragments/")
interviews = playlist(reload=300, "/var/www/vhosts/kurenniemi.activearchives.org/httpdocs/dataradio/interviews/")
testnorm=playlist(reload=300, "/var/www/vhosts/kurenniemi.activearchives.org/httpdocs/dataradio/test-norm/")
daypls=playlist(reload=300,mode='normal', "/var/www/vhosts/kurenniemi.activearchives.org/dataradio/playlist.day.txt")
nightpls=playlist("/var/www/vhosts/kurenniemi.activearchives.org/dataradio/cassettes/")
#radio = testnorm
# radio = random(weights = [3, 1, 12], [cassette_extracts, interviews, programs])
#radio = random(weights = [1], [programs])
# radio = audio_to_stereo(radio)
# radio=daypls
 
# ALLOW LIVE RELAY INTERUPTION
full =
  fallback(track_sensitive=false,
           [input.http("http://localhost:2048/live.ogg"),
            switch([({ 10h-20h }, daypls),
                    ({ 20h-10h }, nightpls)]),
            brown])
enable_replaygain_metadata ()
full = amplify(1.,override="replay_gain",full)
# Add Metadata ircbot tap
def on_meta (meta)
    # print("*ON_META*")
    # list.iter(fun (i) -> print(fst(i)^": "^snd(i)), meta)
    data = string.concat(separator="\n",list.map(fun (i) -> fst(i)^":"^snd(i), meta))
    system (scripts^"recordmeta 'metadata' "^quote(data))
end
# 22 oct 2013, MM: temporarilty disabling meta
full = on_metadata(on_meta, full)
 
# Output the full stream in OGG and MP3
#output.icecast.mp3( 
#  host="localhost",port=2048,password="thelibraryofbabel",
#  mount="dataradio.mp3",full)
 
output.icecast.vorbis( 
  host="localhost",port=2048,password="sniffandsneak",
  mount="dataradio.ogg", clear_metadata(normalize(full)))
 
#output.file.vorbis( 
#  "stream_%SMHdmY.ogg", clear_metadata(normalize(full)))
 
# experiment at lower quality stream
#output.icecast.vorbis( 
#  host="localhost",port=2048,password="thelibraryofbabel",
#  mount="dataradio.ogg",
#  stereo=false,
#  samplerate=22050,
#  clear_metadata(normalize(full)))
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox