Sign in to follow this  
Axiverse

wav format basics...

Recommended Posts

Please help... I am in dispair from all the gibberish that makes up the wav format... Is there anyone that knows and would share the basics of wav? Just enough so i can stream a dynamically created piece of wav into a DirectSound buffer and play it?

Share this post


Link to post
Share on other sites
i would imagine that the native format for DirectSound is a wav file. you shouldn't need to decipher anything. just point the sound buffer to the wav or copy the wav to the buffer, right? have you tried reading the docs for DirectSound?

-me

Share this post


Link to post
Share on other sites
Mathematically generating sound requires a decent understanding of DSP (Digital Signal Processing). There are tons of good resources and tutorials out there, for a starting point see musicdsp.org.

But for a quick answer to your question, the numbers in the sound buffer represent the amplitude (the height) of the sound waveform at the time point. The way that this is converted into the speaker moving is actually non-trivial, but it is not a 1 to 1 mapping.

For example, to generate a simple pure tone, you use the sin() function and place sin(x), sin(x+offset), sin(x+offset*2), sin(x+offset*3), etc. Offset would be some value appropriate to the output frequency (that 44,100 Hz you see in sound programs, etc.) to generate the tone.

I'm currently building a little synthesizer in my blog and there is some very basic sound tutorials there as well.

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