0

Possible Duplicate:
Frequency Analyzer in C#

I am looking for easy way(or any way) to get the current sound frequency from the computer microphone. I would like to make a guitar tuner of my own.

How to get this frequency using C#?

Is there any algorithm if such library does not exist?

Community
  • 1
  • 1
Robert
  • 233
  • 3
  • 12
  • But i would like the real time sound. Not the audio file. – Robert Nov 06 '12 at 00:09
  • Most sound is a combination of frequencies, unless your sound source is a pure sine wave. – Robert Harvey Nov 06 '12 at 00:12
  • @RobertHarvey It will be close to it. I would like to make a guitar tuner of my own. – Robert Nov 06 '12 at 00:15
  • [Fast Fourier Transform](http://en.wikipedia.org/wiki/Fast_Fourier_transform) is the algorithm you're looking for, and there are plenty of implementations around. Now all you need is the PCM audio data from your mic. – neeKo Nov 06 '12 at 00:30
  • @NikoDrašković Is there any c# library which provides that one. I have no reason to implement it by my own. – Robert Nov 06 '12 at 00:33
  • I'd give [this answer](http://stackoverflow.com/questions/170394/fast-fourier-transform-in-c-sharp) a try :) (I believe I've actually used the one in the second answer, but that was a long time ago...) – neeKo Nov 06 '12 at 00:33
  • @NikoDrašković Please post it as answer so I can accept it. – Robert Nov 06 '12 at 00:35

1 Answers1

0

You could try using Fast Fourier Transform algorithm.

There should be a fair number of implementations in C#, and some of those could be found in this stackoverflow question.

Community
  • 1
  • 1
neeKo
  • 4,280
  • 23
  • 31