Log in

View Full Version : Make the Audio Louder


jay123210599
13th October 2024, 00:35
I want to increase the volume of my audio files and the ones in my videos to make them sound louder. How do I do that?

FranceBB
13th October 2024, 00:56
There are different approaches you could have based on what you wanna achieve and with what tools you want to achieve it.
In any case, you'll have to re-encode the audio track, so either way it's fine.
The first is a simple approach and it uses Avisynth to just "raise" the volume in all channels equally according to how much you want it to go up.


#Indexing
video=LWLibavVideoSource("file.mxf")
audio=LWLibavAudioSource("file.mxf")
AudioDub(video, audio)

#Make it twice as loud
Amplify(2.0)


and then you can encode the output of that with whatever audio encoder you want, like

ffmpeg.exe -i "AVS Script.avs" -c:a pcm_s24le -ar 48000 -f wav "audio.wav"

If you do that, please make sure to use Histogram(mode="audiolevels") or indeed my VideoTek() to check that your audio doesn't get too loud and ends up hitting the ceiling of 0 dB (i.e clipping).

Obviously a better approach would be to actually perform a proper loudness correction and in this case you can use FFMpeg's loudnorm filter to set your target.
For instance, here I'm setting a target of -18 LUFS (same as CD) which is pretty loud compared to most movies and tv series that are generally produced at -23 LUFS.

ffmpeg.exe -i "audio.wav" -c:a pcm_s24le -ar 48000 -af loudnorm=I=-18:LRA=12:tp=-2 -f wav "audio_LC.wav"

I gotta be fair, most of the time I actually have to make audio quieter rather than louder as pretty much every content on Earth is at -23 LUFS and the Italian AGCOM standard for transmissions is -24 LUFS, so 1 DB quieter, and that has its own problem as well. Professionally, at work, I'm relying on the Dolby DP600 which has something called the "Dolby Dialogue Intelligence" which detects the speech even in stereo files where you don't have something as obvious as the center channel - unlike 5.1 - and it performs the loudness correction by treating speech differently. Anyway, that's another can of worm I don't wanna get into. I hope this helps and I would strongly suggest loudnorm for your goal. ;)

hello_hello
13th October 2024, 02:54
If the audio happens to be AAC or MP3 and you just want to increase the volume (not compress it) there's no need to re-encode.
Although it's an audio player, even if they contain video, Foobar2000 will run a ReplayGain/EBU R128 scan on the audio in MKVs and MP4s, save the ReplayGain information, and optionally adjust the volume of the audio without having to extract it first. It supports multi-channel audio. The only restriction is that when you adjust the volume of MP3 and AAC audio losslessly, it has to be done in increments of 1.5 dB.

LoudNorm is quite good but I'd only use it for overly dynamic audio, especially if it's AAC or MP3 as it requires re-encoding. It wouldn't be necessary for pop music or even old TV shows or movies.

If you do that, please make sure to use Histogram(mode="audiolevels") or indeed my VideoTek() to check that your audio doesn't get too loud and ends up hitting the ceiling of 0 dB (i.e clipping).

Wouldn't you be better off using Normalize() rather than Amplify(2.0)?
It requires 2 passes so it takes longer, but at least you wouldn't have to check the peaks.

manolito
13th October 2024, 03:56
@ jay123210599

If you want to dig a little deeper you may want to have a look at some of my older posts about this topic.

https://forum.doom9.org/showthread.php?p=1813858#post1813858
https://forum.doom9.org/showthread.php?p=1935728#post1935728

It is important to understand the difference between a linear volume correction (without changing the dynamic range), or if you need a real dynamic range adjustment.


Cheers
manolito

GeoffreyA
13th October 2024, 07:39
With reference to loudnorm, I believe I found a bug recently. When the file is long enough, I think, it shows an assertion error somewhere near the end. This came up in experimenting with Lawrence of Arabia, which clocks in at about ~3:40:00.