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
11if getenv("STREAM_MOUNTPOINT") == "" then
12 setenv("STREAM_MOUNTPOINT", "live")
13end
14
15# Playlist
16i_playlist = normalize(
17 playlist(
18 id="playlist",
19 mode="random",
20 reload=600,
21 "/music"
22 )
23)
24
25# Silence
26i_silence = blank(id="blank")
27
28# Fallback to Silence if Playlist dies for some reason
29radio = fallback(
30 track_sensitive=false,
31 [ i_playlist, i_silence ]
32)
33
34# Output
35output.icecast(
36 %mp3(
37 bitrate=128,
38 id3v2=true
39 ),
40 name = getenv("STREAM_NAME"),
41 description = getenv("STREAM_DESC"),
42 url = getenv("STREAM_URL"),
43 mount = getenv("STREAM_MOUNTPOINT"),
44 password = getenv("ICECAST_SOURCE_PASSWORD"),
45 host = "icecast",
46 port = 8000,
47 encoding = "UTF-8",
48 radio
49)