DirectSound to variables

Started by
0 comments, last by unbird 14 years, 3 months ago
Hi;) (again I'm just asking for WuTz) How can I catch the sound output of windows and transform the frequencies to variables? I have found that thread, but i does't help us:( http://www.gamedev.net/community/forums/topic.asp?topic_id=527270&whichpage=1� In addition to that WuTz would like to know how he can use the variables from the capturebuffer->lock function? How can he get the frequencies from that? I hope you can help us;)
Advertisement
Your question is confusing, I think we have to clarify things first:

- When capturing data from a windows sound capturing device, you don't get frequencies (normally), but raw data. Furthermore it is important to know what format the data has (8/16 bit, signed/unsigned integer or floats and of course how many channels i.e. mono/stereo).

- When you have access to the raw data you can process the data further. I assume your "frequency to variables" means a spectrogram, i.e. extracting levels of different frequencies. This is done with a so-called Fourier-Transformation, for discrete data like the above, you normally use a speed-optimized variant called fast-fourier-transformation (FFT).

- If you mean to extract the "main" frequency of a signal, this is called pitch detection. Here you do a spectragram, too, but you're not done. Pitch detection is much more complicated and depends on what signal you have and as far as I know there's no "silver bullet" (a solution that always works) for that.

- Do you want an offline or online analysis (first "record" then analyze, or real-time, i.e. on-the-fly). For the latter things get more complicated and you probably have to resort to concurrent programming (threads). Also, depending on the frequency resolution you are targeting and what programming language or processor power you have, you might run into performance problems.

- Re-capturing sound output of windows should be possible, as far as I know, but I bet it depends on what sound hardware you have and what a driver accepts doing. In the age of Digital Right Management you probably sometimes won't have access to digital quality data or no access at all. Anyway: When setting your capturing device, make sure to have a look at the windows mixer (muted devices won't send you anything).


Here is a good example of both FFT and simple pitch detection of a real-time captured sound device, using MDX and C#:

http://www.codeproject.com/KB/audio-video/FftGuitarTuner.aspx


unbird

This topic is closed to new replies.

Advertisement