I need help loading a wave file for playing........
Well I have Isometric Game Programming with Directx 7.........this book has been "ok" so far, not great, just "ok", but I must tell you that it did a terrible job on showing people how to load a freaking wave file for playing......I tried, I even basically copied the entire source code from the tutorial.......it compiled good but then it just crashed the small program.
//set up buffer description
HANDLE hFile, // handle of file to read
LPVOID lpBuffer, // address of buffer that receives data
DWORD nNumberOfBytesToRead, // number of bytes to read
LPDWORD lpNumberOfBytesRead, // address of number of bytes read
LPOVERLAPPED lpOverlapped // address of structure for data
ReadFile(hfile,&dwLength,sizeof(dwLength),&dwNumRead,NULL);//length of file
ReadFile(hfile,&dwLength,sizeof(dwLength),&dwNumRead,NULL);//length of chunk
//dependin on the chunk header, do something
if(strcmp("fmt ",Buffer)==0)// if the chunk contains the world "fmt "
//clear out format
//memcpy (&destination, &source, lenghtofbytes)
//copy from buffer
//allocate data buffer
//we are done, and need no more chunks
//close the file
//copy from wave loader to sound buffer
Don't know what's wrong with it, I can't really check my mistakes on it, because as I said before I am not really up to date on knowing how to do that.......does anybody know what's wrong with this? Or knows a GOOD tutorial for this? I looked at a tutorial on gamedev.net and the guy says that doesn't even know if his tutorial compiles, so for someone like me who's having problems with it, maybe this isn't the best way to go. Or does anybody know how to do this an easier way? Please I need help people.