如何跟踪没有声音区域在WAV文件? [英] How To Track No Sound Area In A Wav File?
本文介绍了如何跟踪没有声音区域在WAV文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家。
如何跟踪无声音部分的wav文件?
一个小软件什么,我想开发的deviding一个wav文件,并考虑没有音量区域作为deviding点。
程序怎么能知道一个wav文件的该卷是低?
我将使用Java或MFC。
everyone. How to track sections without sounds in a wav file? a small software what I want to develop is deviding a wav file, and it consider a no volume area as a deviding point. how can a program know that volume of a wav file is low? I'll use Java or MFC.
推荐答案
我通过计算信号的RMS曾与静音检测成功。这是通过以下方式完成的(假设有音频采样的阵列):
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));
如果RMS是低于某一阈值时,可以考虑它是无声的。
if rms is below a certain threshold, you can consider it being silent.
这篇关于如何跟踪没有声音区域在WAV文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文