i am using audacity 2.1.2 on windows 7 .
I want to create a script that reads an mp3 and picks out parts to normalize.
Here is my idea ,
Suppose we can sample audio amplitude at every 10 millisecond .
So it reads audio amplitude at beginning of file (say s) . reads amplitude after every 10 millisecond . When it encounters sample (say at position x) with amplitude s/2 or 3s/2 (+-50%) it stops, Normalizes the beginning till here .
This way , we will process mp3 till the end .
position=0
while(position<end_of_file)
{ beginning=position;
present_vol=amp_at_position
do
{ position=position+10millisecond;
}while(amp_at_position>present_vol/2 && amp_at_position<3*present_vol/2 && position<end_of_file)
normalize(beginning to position)
};
Is it possible ?
Actually I have sound files with silent and loud parts.
It ain't music , just dialogue .
I want it to be equally loud at all places.
Thanks.
normalizing sections of audio file
Forum rules
This forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Re: normalizing sections of audio file
It sounds like you have re-invented the "dynamic range compression".manit123 wrote:Suppose we can sample audio amplitude at every 10 millisecond .
So it reads audio amplitude at beginning of file (say s) . reads amplitude after every 10 millisecond . When it encounters sample (say at position x) with amplitude s/2 or 3s/2 (+-50%) it stops, Normalizes the beginning till here .
This way , we will process mp3 till the end .
The effect would need to be more sophisticated than you describe in order to achieve reasonable sound quality.
If you simply amplify (normalize) 10 ms sections, then there will be a click every time the amplification amount ("gain") changes. To avoid the clicks, the gain would need to change progressively, so that when a quiet section is encountered, the gain is ramped up over a period of time. In a "compressor" effect, that period of time is called the "attack time". When the input level rises again, the gain would need to ramp down over a period of time (the "release time"). In a "compressor" effect, the strength of your normalize function is called the "compression ratio". If you are normalizing each 10 ms window to the same level, then that's a compression ratio of "infinity:1".
You would also need to not normalize sounds below a lower threshold, otherwise the noise in any "silent" parts would also be normalized. This lower threshold is usually called the "floor".
See this topic: http://forum.audacityteam.org/viewtopic ... 42&t=68501manit123 wrote:Actually I have sound files with silent and loud parts.
It ain't music , just dialogue .
I want it to be equally loud at all places.
The best version of that effect is the one by Nicholas K in this post: http://forum.audacityteam.org/viewtopic ... 21#p299521
The "manual" for the effect is in the first post: http://forum.audacityteam.org/viewtopic ... 79#p194179
Instructions for installing the effect are here: http://manual.audacityteam.org/man/effe ... st_effects
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: normalizing sections of audio file
i will look into it .
i had noticed earlier that you get a noise when you normalize silent part of an audio file , as you said.
Thanks.
i had noticed earlier that you get a noise when you normalize silent part of an audio file , as you said.
Thanks.