Jump to content
  • Advertisement
Sign in to follow this  
unrealer2

DirectSound to variables

This topic is 3119 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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;)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!