views:

172

answers:

3

I am using .NET 3.5.

I need to Capture Sound from Mic/Headphone and trigger action at particular (not exact) frequency (Need to perform some action when player hits ball with stick while playing golf).

So,
1. How to capture sound from Mic/Headphone using .NET 3.5?
2. Trigger action at particular (not exact) frequency?

Any ideas?

A: 

For part two, take a look at this question.

Mike Mueller
FFT is somewhat overkill for this. A simple filter or the Goertzel algo would be sufficient.
Paul R
+2  A: 

For (2) I suggest the Goertzel algorithm, which is very simple to implement and will allow you to detect energy in a narrow range of frequencies.

Paul R
A: 

Thank you for quick answer.

I need to record audio and measure frequency at the same time.

Found one good sample at: http://voicerecorder.codeplex.com/.

Its exactly what I want. But written in WPF. Does anyone have same sample (measuring frequency while recording) written in .NET 3.5?

Chintan Shah
This is not an answer - it should be a comment to someone else's answer or an addition to your original question
Paul R