How to get the volume of an MP3 file?

I need to get the average volume of an mp3 file in dB. It must be that when listening to multiple files, the volume is automatically adjusted. In this case, the files themselves do not need normalization. Ideally, I need to get the result on the command line, but just an algorithm will do.

+7
command mp3 volume
source share
3 answers

The stat predicate SoX gives all kinds of statistics about audio stream:

sox <file.mp3> -n stat

+10
source share

Some answers here: calculate average mp3 volume

May be useful: http://normalize.nongnu.org/

0
source share

Check out the Replay Gain standard . Audio players such as foobar2000 can apply algrorithm to your ripped CDs or music collection to normalize the average volumes of tracks in the track area or album area without changing the audio content of the files.

From the HydrogenAudio Wiki :

Replay Gain is the name of a method invented to achieve the same playback volume of audio files. It sets a reference level of 89 dB and an algorithm for measuring the perceived loudness of audio data.

Replay Gain allows the volume of each song in the song collection to be consistent. This is called "Track Gain" or "Radio Gain" in an earlier language. It also allows the volume of a particular subsection (β€œalbum”) to fit the rest of the collection, allowing the dynamics from song to song on the album to remain intact. This is called "Album Gain" or "Audiophile Gain" in an earlier language. This is usually important when listening to classic music albums, because quiet tracks should remain somewhat quieter than loud.

Replay Gain is different from peak normalization. Peak normalization simply ensures that the peak amplitude reaches a certain level. This does not provide equal volume. The Replay Gain technique measures the effective power of a waveform (i.e., the RMS power after applying an β€œequal volume circuit”), and then adjusts the waveform amplitude accordingly. The result is that the reproduction signals obtained during reproduction are usually more uniformly amplified than peak normalized waveforms.

The wiki page also lists various implementations and related tools. Perhaps one of them will be right for you!

0
source share

All Articles