我需要以 dB 为单位获取 mp3 文件的平均音量。这一定是在收听多个文件时自动调节音量。在这种情况下,文件本身不需要规范化。理想情况下,我需要在命令行中得到一个结果,但适合并且只是一个算法。
3 回答
SoX的stat
谓词给出了有关音频流的各种统计信息:
sox <file.mp3> -n stat
Check out the Replay Gain standard. Audio players such as foobar2000 can apply the algrorithm to your ripped CDs or music collection to normalize the average volumes of tracks at track-scope or album-scope without changing the audio content of the files.
From the HydrogenAudio Wiki:
Replay Gain is the name of a technique invented to achieve the same playback volume of audio files. It specifies the reference level of 89dB and an algorithm to measure the perceived loudness of audio data.
Replay Gain allows the loudness of each song within a collection of songs to be consistent. This is called 'Track Gain', or 'Radio Gain' in earlier parlance. It also allows the loudness of a specific sub-collection (an "album") to be consistent with the rest of the collection, while allowing the dynamics from song to song on the album to remain intact. This is called 'Album Gain', or 'Audiophile Gain' in earlier parlance. This is usually important when listening to classical music albums, because quiet tracks need to remain a certain degree quieter than the louder ones.
Replay Gain is different from peak normalization. Peak normalization merely ensures that the peak amplitude reaches a certain level. This does not ensure equal loudness. The Replay Gain technique measures the effective power of the waveform (i.e. the RMS power after applying an "equal loudness contour"), and then adjusts the amplitude of the waveform accordingly. The result is that Replay Gained waveforms are usually more uniformly amplified then peak-normalized waveforms.
The wiki page also lists various implementations and related tools. Maybe one of these will be right for you!
这里有一些答案: 计算 mp3 平均音量
可能有用: http: //normalize.nongnu.org/