1#!/usr/bin/liquidsoap
2# This is the EU R128 standard
3settings.lufs.track_gain_target := -23.
4# Enable LUFS compute if missing from files
5enable_lufs_track_gain_metadata()
6
7# Enable the autocue metadata resolver
8enable_autocue_metadata()
9
10# Playlist
11i_playlist = crossfade(
12 duration=3.0,
13 blank.eat(
14 at_beginning=true,
15 start_blank=true,
16 max_blank=1.0,
17 threshold=-45.0,
18 normalize_track_gain(
19 playlist(
20 mode="randomize",
21 reload=1,
22 reload_mode="rounds",
23 "/music"
24 )
25 )
26 )
27)
28
29# Make it safe
30radio = mksafe(i_playlist)
31
32# Output
33output.icecast(
34 %mp3(
35 bitrate=128,
36 id3v2=true
37 ),
38 name=environment.get("STREAM_NAME", default="Radio"),
39 description=environment.get("STREAM_DESC", default="Our selection of music"),
40 url=environment.get("STREAM_URL"),
41 mount=environment.get("STREAM_MOUNTPOINT", default="live"),
42 password=environment.get("ICECAST_SOURCE_PASSWORD", default="hackme"),
43 host="icecast",
44 port=8000,
45 encoding="UTF-8",
46 radio
47)