Jump to content
  • Advertisement
Sign in to follow this  
Axiverse

wav format basics...

This topic is 4997 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

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
Advertisement
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
well, ok...

I want to mathmatically generate a sound so...

1 more question... are samples the specific position of the speaker? like high numbers would mean the speaker is out and low numbers mean the speaker is in?

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
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!