DirectSound Question

imported_nautique

Senior member
Jul 14, 2004
346
0
0
I am having trouble getting an audio player I wrote to play back well. Right now the beginning of the song is played back fine and then after about 2 or 3 seconds (I buffer up 3 secs) it starts to skip. Sounds like a scratched cd.

My first question is about IDirectSoundBuffer8::Lock. For the dwFlags parameter, I was using the DSBLOCK_ENTIREBUFFER value, but someone told me to use "0" there instead. Could someone explain to me what the "0" does and why to use that instead of DSBLOCK_ENTIREBUFFER? Does it still ignore either the dwOffset or dwBytes?

Also, it seems that on the first memcpy to the buffer (filling the entire buffer), everything works great. Then when I try to copy a certain section that was just played, the Lock method is giving me the wrong address back and its overwriting data that has yet to be played? Does anyone have any knowledge as to why that might be happening? I am at a stand still and any advice would be great appreciated.

Thanks in advance.

DN