Look, you need to mix a voiceover with some background music. Forget those clunky, expensive audio editors. If you’re a developer or admin, you use the terminal. This is how you get it done, fast and clean, with FFmpeg.
The Command You Need
This command takes your two audio files, adjusts the background volume, and spits out a single, polished track. It’s efficient. It’s simple. It works.
Open your terminal. Navigate to where your audio files are. Then run this:
ffmpeg -i voiceover.mp3 -i background.mp3 -filter_complex "[1:a]volume=0.3[a1];[0:a][a1]amix=inputs=2[a]" -map "[a]" output_with_voiceover.mp3
Understanding the Syntax
For those who need to understand why it works:
-
-i voiceover.mp3 -i background.mp3
: These are your input files. The first one,voiceover.mp3
, is[0:a]
. The second,background.mp3
, is[1:a]
. Basic I/O. -
[1:a]volume=0.3[a1]
: This takes your background audio,[1:a]
, and drops its volume to 30%. You can change0.3
to whatever level you need. Adjust it. Don’t just blindly copy. -
[0:a][a1]amix=inputs=2[a]
: This is the core mixing operation. Your voiceover ([0:a]
) and the adjusted background ([a1]
) are combined.amix
takes two inputs. Simple. -
-map "[a]"
: This ensures the final, combined audio stream[a]
is outputted. Don’t skip this. -
output_with_voiceover.mp3
: This is the name of your final mixed file. Call it something descriptive, or don’t. Your choice.
Get FFmpeg Installed
Before any of this works, you need FFmpeg. If you’re running Ubuntu and don’t have it already, here’s how you install it. This should be standard procedure for any decent admin or developer.
sudo apt update
sudo apt install ffmpeg