1# Set environments if empty
2if getenv("ICECAST_SOURCE_PASSWORD") == "" then
3 setenv("ICECAST_SOURCE_PASSWORD", "hackme")
4end
5if getenv("STREAM_NAME") == "" then
6 setenv("STREAM_NAME", "Radio")
7end
8if getenv("STREAM_DESC") == "" then
9 setenv("STREAM_DESC", "Our selection of music")
10end
11
12# Playlist
13i_playlist = normalize(
14 playlist(
15 id="playlist",
16 mode="random",
17 reload=600,
18 "/music"
19 )
20)
21
22# Silence
23i_silence = blank(id="blank")
24
25# Fallback to Silence if Playlist dies for some reason
26radio = fallback(
27 track_sensitive=false,
28 [ i_playlist, i_silence ]
29)
30
31# Output
32output.icecast(
33 %mp3(
34 bitrate=128,
35 id3v2=true
36 ),
37 name = getenv("STREAM_NAME"),
38 description = getenv("STREAM_DESC"),
39 url = getenv("STREAM_URL"),
40 mount = "live",
41 password = getenv("ICECAST_SOURCE_PASSWORD"),
42 host = "icecast",
43 port = 8000,
44 radio
45)