papillon-ls1.liq 4.6 KB
Newer Older
hark's avatar
new ls  
hark committed
1 2 3 4
#!/usr/bin/liquidsoap

# We're 48k!
set("frame.audio.samplerate",48000)
hark's avatar
hark committed
5
set("harbor.bind","0.0.0.0")
hark's avatar
new ls  
hark committed
6 7 8 9 10 11 12 13 14
set("harbor.password","source")
set("harbor.password","hackme")
# Put the log file in some directory where
# you have permission to write.
set("log.file.path","/tmp/<script>.log")
# Print log messages to the console,
# can also be done by passing the -v option to liquidsoap.
set("log.stdout", true)
# Use the telnet server for requests
hark's avatar
ports  
hark committed
15 16 17
set("server.telnet.port", 9051)


hark's avatar
new ls  
hark committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
set("server.telnet", true)



# Add a skip function to a source
# when it does not have one
# by default
def add_skip_command(s) =
 # A command to skip
 def skip(_) =
   source.skip(s)
   "Done!"
 end
 # Register the command:
 server.register(namespace="#{source.id(s)}",
                 usage="skip",
                 description="Skip the current song.",
                 "skip",skip)
end

# Lines starting with # are comments, they are ignored.

# A bunch of files and playlists,
# supposedly all located in the same base dir.

hark's avatar
hark committed
43 44
#default = mksafe(single("~/src/streaming-media-stuff/liquidsoap/technical-problem.ogg"))
default = noise()
hark's avatar
new ls  
hark committed
45 46 47 48 49 50 51
notlive = single("~/src/streaming-media-stuff/liquidsoap/notlive.ogg")

jingles     	= playlist(timeout=20.0,mode="random",reload=300,reload_mode="seconds","/mnt/radio/jingles")
#musicsquat     	= playlist(timeout=20.0,mode="random",reload=300,reload_mode="seconds","/mnt/storage5/radio/music_squat_related/albums/")
#musicsquatlive     = playlist(timeout=20.0,mode="random",reload=300,reload_mode="seconds","/mnt/storage5/radio/music_squat_related/live/")
#talks     = playlist(reload=600, "/mnt/radio/talks/")
papillon_archive     = playlist(reload=600, "/mnt/radio/papillon_archive/")
buildbox's avatar
buildbox committed
52 53 54
#output.dummy(fallible=true, papillon)


hark's avatar
new ls  
hark committed
55
admfest = playlist(reload=600, "/mnt/radio/Live Recordings/")
buildbox's avatar
buildbox committed
56 57 58
#output.dummy(fallible=true, archive_mix)


hark's avatar
new ls  
hark committed
59
archive_mix = random(weights=[1,1,2,2],[ jingles, notlive, papillon_archive, admfest ])
buildbox's avatar
buildbox committed
60 61
#output.dummy(fallible=true, archive_mix)

hark's avatar
new ls  
hark committed
62 63 64 65 66 67 68


#radio = random(weights=[3,5,2,1,1,2,2],[ jingles, musicsquat, musicsquatlive, talks, notlive, archive, admfest ])

# Attach a skip command to the source s:
add_skip_command(archive_mix)

nixopper's avatar
nixopper committed
69
#strip_blank(length=5.,live)
buildbox's avatar
buildbox committed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
#papa = strip_blank(max_blank=115.,input.harbor(id="pap-a", port=8051,  "pap-a"))
#papb = strip_blank(max_blank=115.,input.harbor(id="pap-b", port=8051, "pap-b"))
#papc = strip_blank(max_blank=115.,input.harbor(id="pap-c", port=8051, "pap-c"))
#papd = strip_blank(max_blank=115.,input.harbor(id="pap-d", port=8051, "pap-d"))
#pape = strip_blank(max_blank=115.,input.harbor(id="pap-e", port=8051, "pap-e"))
papa = strip_blank(max_blank=10.,audio_to_stereo(buffer.adaptative(mksafe(input.harbor(id="pap-a", buffer=6.0, max=60.0, port=8051,  "pap-a")))))
output.dummy(fallible=true, papa)

papb = strip_blank(max_blank=60.,audio_to_stereo(buffer.adaptative(mksafe(input.harbor(id="pap-b", buffer=30.0, max=60.0, port=8051, "pap-b")))))
#papb = strip_blank(max_blank=115.,input.harbor(id="pap-b", port=8051, "pap-b"))

output.dummy(fallible=true, papb)

papc = audio_to_stereo(input.harbor(id="pap-c", port=8051, "pap-c"))
output.dummy(fallible=true, papc)

papd = audio_to_stereo(strip_blank(max_blank=115.,input.harbor(id="pap-d", port=8051, "pap-d")))
output.dummy(fallible=true, papd)

pape = audio_to_stereo(strip_blank(max_blank=115.,input.harbor(id="pap-e", port=8051, "pap-e")))
output.dummy(fallible=true, pape)

hark's avatar
new ls  
hark committed
92

hark's avatar
hark committed
93

hark's avatar
pass  
hark committed
94

nixopper's avatar
nixopper committed
95
full = fallback(track_sensitive = false, [papa, papb, papc, papd, pape, normalize(smart_crossfade(archive_mix)), default ])
hark's avatar
hark committed
96

hark's avatar
new ls  
hark committed
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111


### stream outputs in pap-streams.liq


%include "pap-streams.liq"

#icecast_archive_flac(full, host="10.205.25.56", port=8000, password="icecold")
#icecast_archive_flac(full, host="10.205.25.56", port=8000, password="icecold")
#icecast_archive_aac(full, host="deathstar.puscii.nl", port=8000, password="icecold")

icecast_ogg(full, mount="pap-ls1.ogg", host="deathstar.puscii.nl", port=8000, password="icecold")
icecast_mp3(full, mount="pap-ls1.mp3", host="deathstar.puscii.nl", port=8000, password="icecold")
icecast_opus(full,mount="pap-ls1.opus", host="deathstar.puscii.nl", port=8000, password="icecold")

hark's avatar
hark committed
112 113 114
#icecast_ogg(full, mount="pap-ls1.ogg", host="localhost", port=8000,  password="WXyo3SmT")
#icecast_mp3(full, mount="pap-ls1.mp3", host="localhost", port=8000, password="WXyo3SmT")
#icecast_opus(full,mount="pap-ls1.opus", host="localhost", port=8000,  password="WXyo3SmT")
hark's avatar
pass  
hark committed
115

hark's avatar
hark committed
116 117 118
#icecast_ogg(full, mount="pap-ls1.ogg", host="10.205.12.40", port=8000, password="WXyo3SmT")
#icecast_mp3(full, mount="pap-ls1.mp3", host="10.205.12.40", port=8000, password="WXyo3SmT")
#icecast_opus(full,mount="pap-ls1.opus", host="10.205.12.40", port=8000, password="WXyo3SmT")
hark's avatar
pass  
hark committed
119 120