Sign in to follow this  

DirectSound to variables

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:(� 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
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#:


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this