normalizing sections of audio file
Posted: Mon Nov 21, 2016 4:45 am
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.
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.