Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Keba

Problem with loading Wave files(Adams book)

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

Hello, i''m using Jim Adams code from the book to loading a wav file, and playing it. But it dosen''t work correct(or i am doing wrong) any way, all my wav files gets rejected when checking: if(memcmp(Hdr->RiffSig,"RIFF",4) || memcmp(Hdr->WaveSig,"WAVE",4) || memcmp(Hdr->formatsig,"fmt",4) || memcmp(Hdr->Datasig,"data",4) ) in the function CreateBufferFromWAV

Share this post


Link to post
Share on other sites
Advertisement
no i didn''t, but i changed, but it still want work
Riffsig = "RIFF\x"
WaveSig = "WAVEfmt"
formatSig = "fmt "
and all of them got a square symbol att the end

Share this post


Link to post
Share on other sites
Probably a quite hacked wav loader (like mine ) ).

The RIFF docs say when you happen onto an unknown segment, skip it. I haven''t heard of a "cue " segment, probably some extra information saved by the wav generator.

Share this post


Link to post
Share on other sites
Somewhere in the MSDN it states the format of RIFF-files. There's actually the chunk code ("fmt ", "data", ...) and the size of the chunk (4 bytes chunk id followed by 4 bytes chunk size). Some chunks allow for nesting.

Try to read that up. All you need to do is skip the unknown chunk by setting the file pointer to the next chunk (with the known chunk size for the current chunk).

[edited by - Endurion on November 11, 2003 1:57:46 PM]

Share this post


Link to post
Share on other sites
thanks for all help, i have located the bug.
i realised that i was trying to play the wav file
with notifications flaggs whitout using the DSBCAPS_CTRLPOSITIONNOTIFY flag when creating the wav file.

Share this post


Link to post
Share on other sites

  • 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!