Problem with loading Wave files(Adams book)
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
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
Riffsig = "RIFF\x"
WaveSig = "WAVEfmt"
formatSig = "fmt "
and all of them got a square symbol att the end
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.
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.
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]
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]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement