数字音频编辑器 [英] digital audio editor

查看:88
本文介绍了数字音频编辑器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建音频编辑器,我在录音窗口上有一个进度条,我希望在那里可以看到说话的时间,而基本上看不到说话的意思,只是根据声音的大小看绿色的声音说
我不确定我是否要说清楚吗?
在此先感谢你们

Im building an audio editor, i got a progress bar on my recording window and i want that in there u can see when u speak, not basically see what u speak just to see the green thing coming out according to how loud u speak
Im not sure if i made myself clear?
thanks in advance guys

推荐答案

如果我正确理解你的话...;)
为此,您应该计算瞬时功率.为此,您可以使用Wave缓冲区并求和数据的绝对值.您应根据采样频率选择缓冲区长度.例如,如果采样频率等于8000 Hz,并且您想要每1秒更新进度条,则需要花费8000点.

使用C#的代码可能如下所示:

If I understand you correctly...;)
To do such thing you should calculate the instant power. To do that you can take wave buffer and summerize the absolute values of the data. The buffer length you should choose according to the sampling frequency. For example, if the sampling frequency equal to 8000 Hz and you want to update progress bar every 1 second it is necessary to take 8000 points.

Code, using C# may look like that:

public static double getPowEst(short[] data)<br />
{<br />
double powEst = 0;<br />
			<br />
for(int t=0; t<code><

data.Length; t ++)
{
powEst + = Math.Abs​​(data [t]);
}

powEst = powEst/data.Length;

返回 powEst;
}

data.Length; t++)
{
powEst += Math.Abs(data[t]);
}

powEst = powEst/data.Length;

return powEst;
}


这篇关于数字音频编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆