Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Contant Peak, Constant RMS (Read 5706 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Contant Peak, Constant RMS

Hi, we are trying to set a default standard for the volume of the audio files we are working on.
We are looking for a tool that, given a bunch of mp3 files, will be able to normalize them at a given db.

For example : 0db for Peak levels and -9db for RMS.

Ideally, we'd love to use sox as we can chain it with other effects we're using without the need to convert multiple time the file from mp3 to wav and back.

We tried sox gain -n , sox gain -ne, sox gain -nb, sox loudness but none of them keep a constant RMS without varying the Peak level as well.
Any help appreciated.
Thanks

Contant Peak, Constant RMS

Reply #1
Assuming that you want the files to be reproduced at what a listener would perceive to be a "standard volume", I suggest you implement "ReplayGain". This adds a tag to the MP3 file which causes any ReplayGain-aware MP3 decoder to adjust the perceived volume on playback to a set level. For non-aware decoders, there is a tool (MP3Gain) which goes through an MP3 file and adjusts the gain on each frame to match the ReplayGain value.
Regards,
   Don Hills
"People hear what they see." - Doris Day


Contant Peak, Constant RMS

Reply #3
Peak and RMS are not tied to one another. Making them so would probably lead to some peculiar results -- not that modern mastering doesn't often produce rather peculiar results. I don't use things like ReplayGain, so I could be quite wrong, but I did not think such tools applied compression, which is a rather more complicated process than adjusting either peak or RMS. The results you aim for will require a multi-band compressor, at the least, or an RMS adjustor plus a ruthlessly used hard limiter.

On the other hand, from the comments I've seen is this forum and other places, most modern pop, rock, and other such genres that one finds widely played on radio, etc. frequently has well less than 9dB total dynamic range to begin with, let alone 9dB between RMS and peak. Of course if you are recording your own material, or getting 50 year old stuff from LP, that is a different matter.

Contant Peak, Constant RMS

Reply #4
It looks like Francesco is building playlists for use in "muzak" type situations - restaurants, bars etc. His media options appear to include MP3 players, audio-only DVDs that can be played on a standard DVD player without a visual display, and music servers that can be updated automatically over the Internet. He wants to:
- Automatically classify tracks using parameters such as "tempo, pitch, loudness, signature, beats, key and so on".
- Arrange the tracks into playlists by genre etc using the above classifications.
- Use MP3 or AAC format to make the track files as small as practical.
- Process the tracks to a consistent loudness for each genre.
- Store the playlists in a format that can be accessed with a minimal user interface (a few buttons).
Regards,
   Don Hills
"People hear what they see." - Doris Day

Contant Peak, Constant RMS

Reply #5
It looks like Francesco is building playlists for use in "muzak" type situations - restaurants, bars etc. His media options appear to include MP3 players, audio-only DVDs that can be played on a standard DVD player without a visual display, and music servers that can be updated automatically over the Internet. He wants to:
- Automatically classify tracks using parameters such as "tempo, pitch, loudness, signature, beats, key and so on".
- Arrange the tracks into playlists by genre etc using the above classifications.
- Use MP3 or AAC format to make the track files as small as practical.
- Process the tracks to a consistent loudness for each genre.
- Store the playlists in a format that can be accessed with a minimal user interface (a few buttons).


Splice,
not sure how you did it, but you're quite right on all you've said

Thanks all for your replies.

We did have a good go with ReplayGain via mp3gain, but could not find a consistent way to normalize files with it.
Instead, it seems mp3gain does a batch analisys and make some sort of average.
When you change the audio batch, the average change, making the volume inconsistent between batches.
What we look for instead is a sort of standard that we and our clients can refer to.

For reference only, this is how we managed to achieve our goal.
It is not the most elegant solution, but it seems to work.

Per each single file:
1) Peak normalization to 0db using sox
2) normalize-audio -a -9dBFS for a standard RMS of around -9db
3) sox vol 0db 0.01 for a soft limiter to prevent clipping



Contant Peak, Constant RMS

Reply #6
If you boost the level by 3dB, the average and peak both increase by 3dB (assuming no limiting or clipping.)  The ratio* between the peak and average is constant unless you do non-linear processing (clipping, limiting, compression).

Quote
1) Peak normalization to 0db using sox
2) normalize-audio -a -9dBFS for a standard RMS of around -9db
You can skip step 1.  Peak Normalization is a volume adjustment, and adjusting to
-9dB is another volume adjustment.

Quote
3) sox vol 0db 0.01 for a soft limiter to prevent clipping
After adjusting to -9dB RMS, you'll have lots of "signal" above 0dB and several dB of limiting, which will probably cause some files to sound distorted.  Soft clipping isn't as noticeable as hard-clipping, but it's still distortion.

Quote
Instead, it seems mp3gain does a batch analisys and make some sort of average.
When you change the audio batch, the average change, making the volume inconsistent between batches.
The "Album Gain" is a batch adjustment to keep the same relative levels throughout the album....  Loud songs remain loud, and quiet songs remain quiet the way the album was intended.  If you choose "Track Gain", the songs are processed independently.

ReplayGain works great for me!, but nothing is perfect!  Two humans might not even agree when two different songs are equally loud, especially if a song has loud-parts and quiet parts.    Dynamic compression and limiting can help a lot, but they destroy the dynamic contrast in the music (if over-done).   



* Decibels are logarithmic, so the dB is a constant number.    If the peaks are twice as loud as the average, that's a 6dB difference and when you increase/decrease the volume (linearly), the ratio remains 2:1 and difference remains 6dB.

Contant Peak, Constant RMS

Reply #7
...
Splice,
not sure how you did it, but you're quite right on all you've said  ...


I just did "Search for all posts by terataz" and read them. Then I thought to myself, "Where have I heard music like this?"
Regards,
   Don Hills
"People hear what they see." - Doris Day