音频音量正常化 [英] audio volume normalization

查看:582
本文介绍了音频音量正常化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写一个音乐播放器,我想归在不同的歌曲音量。

I am writing a music player and I want to normalize the audio volume across different songs.

我能想到的一些不同的方式来做到这一点,例如:

I could think of some different ways to do this, e.g.:


  1. 在所有PCM采样去(假设从-1到1浮点),并选择M = MAX(ABS(样本))。然后因子1 /米适用于所有的PCM样本。这将使峰值处1。

  1. Go through all PCM samples (assume floating point from -1 to 1) and select the m = max(abs(sample)). Then apply the factor 1/m to all the PCM samples. This would make the peak be at 1.

转到通过PCM流,并为每个位置,采取在其周围的一些宽度的汉宁窗,计算绝对样品的平均值,并从这些数据,挑选最大和正常化一切

Go through the PCM stream and for each position, take the Hanning window of some width around it, calculate the average of absolute samples and from those data, pick the maximum and normalize everything.

同为2,但一些其他的方式来获得某种平均值的。

The same as 2 but some other way to get some sort of averaged value.

2和3,我可能需要一些剪裁,从而失去一些质量的缺点。通过不归为1,但至0.95左右,我也许能避免这种在一定程度上,虽然。但我认为2和3的优势,这可能是为用户更自然的正常化。 维基百科也有一些有关此信息,并提到的 RMS 播放增益 EBU R128 衡量一首歌的响度。

2 and 3 have the disadvantage that I might need some clipping and thus loose some quality. By not normalizing to 1 but to 0.95 or so, I maybe could avoid this to some degree, though. But I think 2 and 3 have the advantage that this might be the more natural normalization for the user. Wikipedia also has some information about this and mentions RMS, ReplayGain or EBU R128 to measure the loudness of a song.

如何是其他流行的音乐播放器(如iTunes左右)这样做呢?

How are other popular music players (like iTunes or so) doing this?

推荐答案

iTunes会使用声音检查技术。 声音检查是在功能上类似于播放增益专有的苹果公司的技术,它可以在iTunes和iPod上。 (维基百科)所以,这对我来说是无解的。

iTunes uses the Sound Check technology. "Sound Check is a proprietary Apple Inc. technology similar in function to ReplayGain. It is available in iTunes and on the iPod." (from Wikipedia) So, this is no solution for me.

似乎播放增益是最常见的工艺。该算法解释这里。示例实现是 mp3gain (GPL)或的ffmpeg-播放增益(GPL,从mp3gain派生)。我有我的 rel=\"nofollow\">自己的实现( BSD许可证)。

It seems that ReplayGain is the most common technic. The algorithm is explained here. A sample implementation is mp3gain (GPL) or ffmpeg-replaygain (GPL, derived from mp3gain). I have my own implementation now in my MusicPlayer project (BSD-licence).

又见这些项目的实施:

  • http://sox.sourceforge.net/
  • http://r128gain.sourceforge.net/
  • official ReplayGain homepage
  • official ReplayGain 1.0 specification
  • Wikipedia: ReplayGain

这篇关于音频音量正常化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆