如何使用C#或XNA来衡量声音的频率? [英] How to measure sound frequency using c# or XNA?

查看:355
本文介绍了如何使用C#或XNA来衡量声音的频率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用C#或XNA测量声音的频率?有任何库呢?我想记录的声音,并确定这个声音的频率。

How to measure sound frequency using c# or XNA?? Have any library do it? I want to record sound and identify the frequency of this sound.

推荐答案

你是什么意思的的频率是什么意思?大多数声音,诸如语音,音乐等由频率的整个频谱。所以你基本上是寻找的是一个频谱分析仪。这种光谱可以使用快速傅立叶变换(FFT)来计算。一旦你这样做,你可以看看在频谱的优势频率,如果有一个。

What do you mean by the frequency? Most sounds, such as voice, music etc. consist of an entire spectrum of frequencies. So what you are essentially looking for is a spectrum analyzer. Such a spectrum can be calculated using the Fast Fourier Transform (FFT). Once you have done that, you can look for the dominant frequency in the spectrum, if there is one.

您可能想看看 n音讯以及相关的库如的 WPF声音可视化来看看这是如何在C#来完成。也有使用XNA一个 $ C $的CProject文章捕获麦克风输入,然后使用n音讯用于进一步处理。而本文中的示例是针对Windows Phone的,我想这也应该稍作修改桌面应用程序。

You might want to check out NAudio and related libraries such as the WPF Sound Visualizer to see how this could be done in C#. There is also a CodeProject article that uses XNA to capture microphone input, and then uses NAudio for further processing. While the example in that article is aimed at Windows Phone, I suppose it should also work in a desktop application with minor modifications.

这篇关于如何使用C#或XNA来衡量声音的频率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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