How to track sections without sounds in a wav file?
A small software that I want to develop is dividing a wav file, and it consider a no volume area as a dividing point.
How can a program know that volume of a wav file is low? I'll use Java or MFC.
I've had success with silence detection by calculating RMS of the signal. This is done in the following manner (assuming you have an array of audio samples):
long sumOfSquares = 0;
for (int i = startindex; i <= endindex; i++) {
sumOfSquares = sumOfSquares + samples[i] * samples[i];
}
int numberOfSamples = endindex - startindex + 1;
long rms = Math.sqrt(sumOfSquares / (numberOfSamples));
if rms is below a certain threshold, you can consider it being silent.
Well, a wave file is basically a list of values, which represents a sound wave discretely divided with some rate (44100 Hz usually). Silence is basically when values are near 0. Just set some threshold value and look for continuous ( let's say 100ms length) regions where value is below that threshold.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With