|
|
před 2 týdny | |
|---|---|---|
| Dockerfile | před 3 týdny | |
| README.md | před 2 týdny | |
| bridge.py | před 2 týdny | |
| docker-compose.yml | před 3 týdny |
A high-performance, containerized digital audio bridge that connects Lyrion Music Server (LMS) directly to WLED instances over UDP multicast for zero-latency, sound-reactive LED lighting.
Instead of relying on analog or I2S microphones wired to microcontrollers—which suffer from room acoustics, background noise, and hardware gain clipping—this bridge taps directly into the master digital audio stream, calculates real-time 16-band Fast Fourier Transform (FFT) spectrum analysis on the host CPU, and broadcasts native WLED AudioReactive V2 sync packets across your local network.
255 whiteouts).GAIN_MIN and GAIN_MAX boundaries to prevent gain pumping.00002 header) and broadcast via UDP multicast (239.0.0.1:11988).| Variable | Default | Description |
|---|---|---|
LMS_IP |
127.0.0.1 |
IP address of your LMS / Lyrion server. |
PLAYER_NAME |
WLED-Audio-Sync |
Name of the virtual player in LMS. |
PLAYER_MAC |
02:00:00:11:98:88 |
Unique virtual MAC address for Squeezelite. |
FREQ_MIN |
40.0 |
Lower bound frequency (Hz) for Band 0 (Sub-bass / Kick). |
FREQ_MAX |
12000.0 |
Upper bound frequency (Hz) for Band 15 (Treble / Air). |
GAIN_MIN |
800.0 |
Lower dynamic gain limit (prevents squashing compressed tracks). |
GAIN_MAX |
8500.0 |
Upper dynamic gain limit (prevents amplifying background noise). |
TILT_EXPONENT |
0.42 |
Treble tilt compensation exponent ($1/f$ pink noise curve). |
DECAY_RATE |
0.998 |
Per-frame decay rate for the AGC ceiling (~10s slow decay). |
SILENCE_THRESHOLD |
0.5 |
Peak threshold (0–255 scale) below which the stream is gated. |
UDP_IP |
239.0.0.1 |
Multicast group IP for WLED AudioReactive. |
UDP_PORT |
11988 |
Target UDP port for WLED AudioReactive sync. |
Ensure the container runs with network_mode: host so UDP multicast packets route directly to your local subnet:
```yaml services: wled-audio-bridge:
build: .
container_name: wled-audio-bridge
restart: unless-stopped
network_mode: host
environment:
- LMS_IP=10.0.0.10
- PLAYER_NAME=WLED-Audio-Sync
- FREQ_MIN=40.0
- FREQ_MAX=12000.0
- GAIN_MIN=800.0
- GAIN_MAX=8500.0
command: sh -c "squeezelite -s $$LMS_IP -n$$PLAYER_NAME -m 02:00:00:11:98:88 -o - -r 44100 -d all=info | python3 bridge.py"