User User name Password  
   
Thursday 28.8.2025 / 19:14
Search AfterDawn Forums:        In English   Suomeksi   På svenska
afterdawn.com > forums > digital audio > audio > avi normalize & mp3gain programming?!
Show topics
 
Forums
Forums
AVI Normalize & MP3Gain programming?!
  Jump to:
 
Posted Message
KiNoKe
Newbie
_
10. April 2004 @ 07:31 _ Link to this message    Send private message to this user   
AVI Normalize at http://www.vidomi.com/download.php?op=geninfo&did=19 is 3 utilities which extracts the mp3 from avi file(s) and then normalizes the mp3 in MP3Gain at http://mp3gain.sourceforge.net/and last combine avi with the new mp3-file using NanDub. It's all done by executing a bat-file.

Now here is the problem! MP3Gain(Dos-version, command-line back end) can not Normalize to a specified level(dB of max volume) so it is automated and can still become clip in mp3-audio. I've tried all dos-commandos available in mp3gain.exe but no success.
MP3Gain has a GUI called MP3GainGUI.exe, it normalizes mp3 at a desired dB, so it has more functions.

Here is my question:

Does anyone know how to edit the bat-file so the MP3Gain GUI handles the mp3 instead of MP3Gain DOS?

I've tried to replace mp3gain.exe with MP3GainGUI.exe in bat-file, and when I execute the bat-file it opens the mp3-file in MP3Gain GUI but doesn't normalize it.

The source-code for MP3Gain GUI is at the author's website.

Anyone with programming knowledge(Visual Basic and C++) and script macro commands (bat-file)!

Please Help?!

Ya nee!
Advertisement
_
__
tigre
Moderator
_
11. April 2004 @ 02:02 _ Link to this message    Send private message to this user   
I'm not sure if I understand correctly what you want...

You want to do kind of peak normalization with mp3gain?, i.e. you want it as loud as possible without clipping - correct?

This can be done with mp3gain.exe /r /k infile.mp3

KiNoKe
Newbie
_
11. April 2004 @ 06:01 _ Link to this message    Send private message to this user   
I want to be able to adjust the volume to a desired dB, not max dB without clipping i.e. I want to make the volume 91 dB like in the GUI. Or 70% of max volume.

Ya nee!
tigre
Moderator
_
11. April 2004 @ 07:41 _ Link to this message    Send private message to this user   
Quote:
I want to be able to adjust the volume to a desired dB
mp3gain.exe /r /d 2.0 infile.mp3
Result: The perceived loudness will be 91dB = 89dB (default) + 2dB (-> /d 2.0)

If you do this with movie audio, there are quite big chances that you still get clipping in a few places because movie audio often has a big dynamic range (-> explosions etc.)
Quote:
Or 70% of max volume.
What max volume are you referring to? The highest peak of the waveform or perceived volume as measured by mp3gain? I case it's the former: This has to be done in 2 steps:

mp3gain.exe /r /d 20 /k infile.mp3
mp3gain.exe /g -2 infile.mp3

The 1st step will cause normalization to the highest possible volume without clipping (=> highest peak is between 0 and -1.5dBFS), the /d 20 is to avoid too low volume with loud (overcompressed) tracks, shouldn't be necessary for movies.
The 2nd step will decrease volume by 3.0dB, so the highest peak will be between 70% (= 0 - 3dBFS) and 60% (-1.5 - 3dBFS.

FYI: mp3gain.exe command line options:
Quote:
Usage: mp3gain.exe [options] <infile> [<infile 2> ...]
options:
/v - show version number
/g <i> - apply gain i to mp3 without doing any analysis
/l 0 <i> - apply gain i to channel 0 (left channel) of mp3
without doing any analysis (ONLY works for STEREO mp3s,
not Joint Stereo mp3s)
/l 1 <i> - apply gain i to channel 1 (right channel) of mp3
/r - apply Track gain automatically (all files set to equal loudness)
/k - automatically lower Track gain to not clip audio
/a - apply Album gain automatically (files are all from the same
album: a single gain change is applied to all files, so
their loudness relative to each other remains unchanged,
but the average album loudness is normalized)
/m <i> - modify suggested MP3 gain by integer i
/d <n> - modify suggested dB gain by floating-point n
/c - ignore clipping warning when applying gain
/o - output is a database-friendly tab-delimited list
/t - mp3gain writes modified mp3 to temp file, then deletes original
instead of modifying bytes in original file
/q - Quiet mode: no status messages
/p - Preserve original file timestamp
/x - Only find max. amplitude of mp3
/f - Force mp3gain to assume input file is an MPEG 2 Layer III file
(i.e. don't check for mis-named Layer I or Layer II files)
/? or /h - show this message
/s c - only check stored tag info (no other processing)
/s d - delete stored tag info (no other processing)
/s s - skip (ignore) stored tag info (do not read or write tags)
/s r - force re-calculation (do not read tag info)
/u - undo changes made by mp3gain (based on stored tag info)
/w - "wrap" gain change if gain+change > 255 or gain+change < 0
(use "/? wrap" switch for a complete explanation)
If you specify /r and /a, only the second one will work
If you do not specify /c, the program will stop and ask before
applying gain change to a file that might clip
I think I've understood what you whant to do, but I'm not sure why. If you want to get rid of clipping, you can do what I've suggested in my previous post. Why would you want to lower volume even more? This will decrease signal/noise ratio on playback without any benefit I'm aware of.

KiNoKe
Newbie
_
11. April 2004 @ 09:11 _ Link to this message    Send private message to this user   
Thank you VERY much! It worked.
Quote:
I think I've understood what you want to do, but I'm not sure why. If you want to get rid of clipping, you can do what I've suggested in my previous post. Why would you want to lower volume even more? This will decrease signal/noise ratio on playback without any benefit I'm aware of.
I want that degree of level 'cause I use a DivX DVD-player Called KiSS DP-450 to watch the avis on my TV, and 70% of the highest peak of the waveform is a good high and not too low volume on my player.

By the way! Do you know why mp3gain uses 89 dB for suggested max volume(without clipping)? When Sound Forge say 0 dB(or 100%) is the highest volume. It's totally different info on how you measure volume in sound-files.

I'm totally confused with mp3gain!


Ya nee!
tigre
Moderator
_
11. April 2004 @ 12:38 _ Link to this message    Send private message to this user   
Quote:
By the way! Do you know why mp3gain uses 89 dB for suggested max volume(without clipping)? When Sound Forge say 0 dB(or 100%) is the highest volume. It's totally different info on how you measure volume in sound-files.
These dB values can't be compared.

I don't know Soundforge, but there are two possibilities what "0dB" can mean:

1.:
"0dB" = 100% means that the biggest peak of the waveform is at the max possible amplitude, i.e. 32767 (or -32768) for 16bit resolution. -3dB means 10^(-3/20) = 0.71 = 71% means the peak value is 23197.

2.:
This is what CoolEdit's "Waveform statistics" show: The RMS power ("Root mean squared ampliutde"); a given window is analysed and compared to a reference (either full scale square wave or full scale sine wave defined as 0dB).

mp3Gain (or replaygain for other formats in PC environment) tries to simulate the ear to estimate the perceived volume, i.e. it performs a frequency analysis and multiplies the values with an inverse function of the human absolut treshold of hearing (ATH), i.e. a sine tone at ~ 3000 Hz will raise the estimated value much more then a sine tone at 50 or 15000 Hz with the same amplitude. By adding the values across the spectrum and adding the results of all analysed time windows, the resulting dB value is calculated. I can't tell how 100dB, which seems the upper limit is calculated, it could be defined as what the algorithm calculates for a full scale square wave or white noise with equal distribution. If you want to know more about this http://replaygain.org/ is a good starting point.


Replaygain/Mp3gain is designed (mainly for music) to make tracks (or CDs) sound equally loud, so fiddeling with the volume button isn't necessary e.g. when playing back a mixed playlist. The problem about what dB value to choose as goal is this: Tracks with big dynamic range (mainly classical music), especially when containing lots of low volume parts and only few loud ones, have a low (with replaygain method) measured overall volume. If replaygain/mp3gain is applied, the whole track is amplified, the result can be clipping. On the other hand, the volume of overcompressed recent mainstream music will be lowered by several dB (up to 10 and more) when applying replaygain/mp3gain, resulting in too low volume for many cheap portables.

89dB was chosen as good compromise. For people who listen to classic, jazz and similar genres on decent equipment, lower values like 83dB are recommended (if using replaygain/mp3gain is necessary at all), for ppl who listen to mainstream music on portables with weak output, higher values like ~ 92-95dB might be better.

Advertisement
_
__
 
_
KiNoKe
Newbie
_
12. April 2004 @ 09:06 _ Link to this message    Send private message to this user   
Thanks for your answer, I really appreciate it.

Ya nee!
afterdawn.com > forums > digital audio > audio > avi normalize & mp3gain programming?!
 

Digital video: AfterDawn.com | AfterDawn Forums
Music: MP3Lizard.com
Gaming: Blasteroids.com | Blasteroids Forums | Compare game prices
Software: Software downloads
Blogs: User profile pages
RSS feeds: AfterDawn.com News | Software updates | AfterDawn Forums
International: AfterDawn in Finnish | AfterDawn in Swedish | AfterDawn in Norwegian | download.fi
Navigate: Search | Site map
About us: About AfterDawn Ltd | Advertise on our sites | Rules, Restrictions, Legal disclaimer & Privacy policy
Contact us: Send feedback | Contact our media sales team
 
  © 1999-2025 by AfterDawn Ltd.

  IDG TechNetwork