How to measure sound frequency using c# or XNA? [closed]

烂漫一生 提交于 2019-12-25 08:34:03

问题


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.


回答1:


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.

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.



来源:https://stackoverflow.com/questions/13219365/how-to-measure-sound-frequency-using-c-sharp-or-xna

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!