playlist.liq 3.36 KB
Newer Older
root's avatar
subdirs  
root committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/liquidsoap

set("init.allow_root",true)

# We're 48k!
set("frame.audio.samplerate",48000)
set("harbor.bind","0.0.0.0")
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","/mnt/radio/logs/playlist.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
set("server.telnet.port", 9051)
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.

# local sources
default             = noise()
notlive             = single("/app/notlive.ogg")

jingles             = playlist(timeout=20.0,mode="random",reload=300,reload_mode="seconds","/mnt/radio/jingles")
papillon_archive    = playlist(reload=600, "/mnt/radio/papillon_archive/")
admfest             = playlist(reload=600, "/mnt/radio/Live Recordings/")
archive_mix         = random(weights=[1,1,2,2],[ jingles, notlive, papillon_archive, admfest ])

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


# bunch of inputs
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")))))
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)


full = fallback(track_sensitive = false, [papa, papb, papc, papd, pape, normalize(crossfade(smart=true, archive_mix)), default ])



### stream outputs
vorbis_encoding = %vorbis( quality=0.5, samplerate=48000, channels=2)
mp3_encoding    = %mp3()

icecast_ogg = output.icecast(
  vorbis_encoding,
  connection_timeout=1.0,
  fallible=true,
  url="https://adm.amsterdam/radio",
  genre="papillon archive / not live",
  name="papillon",
  description="lalalal"
)

icecast_mp3 = output.icecast(
  mp3_encoding,
  connection_timeout=1.0,
  fallible=true,
  url="https://adm.amsterdam/radio",
  genre="papillon archive / not live mp3 stream",
  name="papillon",
  description="lalalal"
)


icecast_opus = output.icecast(
  %ogg(%opus),
  connection_timeout=1.0,
  fallible=true,
  url="https://adm.amsterdam/radio",
  genre="papillon archive / not live opus stream",
  name="papillon",
  description="lalalal"
)



icecast_ogg(full, mount="pap-ls1.ogg", host="deathstar.puscii.nl", port=8000, password="icecold")
111
# icecast_mp3(full, mount="pap-ls1.mp3", host="deathstar.puscii.nl", port=8000, password="icecold")
root's avatar
subdirs  
root committed
112
icecast_opus(full,mount="pap-ls1.opus", host="deathstar.puscii.nl", port=8000, password="icecold")