Background music under speech is one of the most common audio problems in video work: a vlog recorded in a café, an interview with a radio in the background, a screen recording with a music track you no longer have the rights to. Simple filters don't solve it, because music and voice share the same frequency range. Here is what actually works, from quick fixes to source separation, with a few lines of code.
Why an EQ isn't enough
Speech lives roughly between 100 Hz and 8 kHz. So does most music. Cutting frequencies removes the music and the voice together. Noise gates don't help either: music is continuous, so the gate either stays open or chops the speech.
Option 1: duck it instead of removing it
If you still have the separate music file, the cleanest fix is sidechain ducking: lower the music only when someone speaks. With FFmpeg:
ffmpeg -i voice.wav -i music.wav -filter_complex \ "[1:a][0:a]sidechaincompress=threshold=0.05:ratio=8:attack=20:release=300[ducked]; \ [0:a][ducked]amix=inputs=2:duration=first[out]" \ -map "[out]" mixed.wav This only works before the mix is baked in. For finished videos you need separation.
Option 2: source separation with a pretrained model
Modern separation models are trained on thousands of songs to split a mix into stems: vocals, drums, bass and "other". For speech over music, the "vocals" stem is your dialogue. With Demucs:
pip install demucs demucs --two-stems=vocals input.wav # output: separated/htdemucs/input/vocals.wav and no_vocals.wav --two-stems=vocals asks for just voice and everything else, which is faster than four stems. For a video, extract the audio first and put it back afterwards:
ffmpeg -i clip.mp4 -vn -ac 2 -ar 44100 audio.wav demucs --two-stems=vocals audio.wav ffmpeg -i clip.mp4 -i separated/htdemucs/audio/vocals.wav -map 0:v -map 1:a -c:v copy -shortest clean.mp4 What to expect
- Clean studio speech over music separates very well.
- Reverberant rooms leave some music bleeding into the voice stem, because the model hears the room as part of the voice.
- Singing over music is the hardest case: the model may treat parts of the melody as vocals.
- Low bitrate sources (heavily compressed social media audio) produce more artifacts. Use the best copy you have.
Without installing anything
Running Demucs needs Python and, ideally, a GPU. For one-off clips, a browser tool is quicker. This tool separates speech from background music in the browser and gives you the cleaned audio to download. Either way, listen to the result on headphones before publishing; artifacts that are invisible on laptop speakers are obvious on good earbuds.