Spaces:
Running
Running
metadata
title: normalize_audio_02
sdk: docker
app_port: 7860
pinned: false
Audio Normalizer (FastAPI)
Local service for loudness normalization using ffmpeg loudnorm (EBU R128).
Requirements
- Python 3.10+
- ffmpeg available in PATH
Setup
cd workers/audio_normalizer
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
Run
uvicorn app:app --host 0.0.0.0 --port 8081
Test (PowerShell)
$form = @{ audio = Get-Item "C:\path\to\input.wav" }
Invoke-RestMethod `
-Uri "http://localhost:8081/normalize?target_lufs=-16&true_peak=-1.0&lra=11" `
-Method Post `
-Form $form `
-OutFile "normalized.wav"
Notes
- Output is WAV by default. Use
output_format=mp3to return MP3. - Headers include measured loudness and applied gain:
X-Input-LUFS,X-Input-TP,X-Input-LRA,X-Target-LUFS,X-Applied-Gain
Optional auth
- Set
NORMALIZE_WORKER_AUTH_KEY(or reuseTTS_WORKER_AUTH_KEY) to requirex-worker-authheader.