Files
op25-docker/op25.liq
Logan Cusano d7146d127b
Some checks failed
Lint / lint (push) Failing after 5s
Fix liquid env vars
2025-10-20 01:48:03 -04:00

49 lines
1.7 KiB
Plaintext

#!/usr/bin/liquidsoap
# Example liquidsoap streaming from op25 to icecast
# (c) 2019-2021 gnorbury@bondcar.com, wllmbecks@gmail.com
#
set("log.stdout", true)
set("log.file", false)
set("log.level", 1)
# Make the native sample rate compatible with op25
set("frame.audio.samplerate", 8000)
# ==========================================================
# 📢 ICECAST CONFIGURATION USING ENVIRONMENT VARIABLES
# Use getenv("VAR_NAME", "default_value")
# ==========================================================
ICE_HOST = getenv("ICE_HOST", "ic2.vpn.cusano.net")
ICE_PORT = int_of_string(getenv("ICE_PORT", "8000"))
ICE_MOUNT = getenv("ICE_MOUNT", "mountpoint")
ICE_PASSWORD = getenv("ICE_PASSWORD", "hackme")
ICE_DESCRIPTION = getenv("ICE_DESCRIPTION", "op25")
ICE_GENRE = getenv("ICE_GENRE", "Public Safety")
# ==========================================================
input = mksafe(input.external(buffer=0.25, channels=2, samplerate=8000, restart_on_error=false, "./audio.py -x 2.5 -s"))
# Consider increasing the buffer value on slow systems such as RPi3. e.g. buffer=0.25
# Compression
input = compress(input, attack = 2.0, gain = 0.0, knee = 13.0, ratio = 2.0, release = 12.3, threshold = -18.0)
# Normalization
input = normalize(input, gain_max = 6.0, gain_min = -6.0, target = -16.0, threshold = -65.0)
# ==========================================================
# OUTPUT: Referencing the new variables
# ==========================================================
output.icecast(
%mp3(bitrate=16, samplerate=22050, stereo=false),
description=ICE_DESCRIPTION,
genre=ICE_GENRE,
url="",
fallible=false,
host=ICE_HOST,
port=ICE_PORT,
mount=ICE_MOUNT,
password=ICE_PASSWORD,
mean(input)
)