🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

How do I PROPERLY check a DirectSound Buffer?

Started by
0 comments, last by SikCiv 24 years, 8 months ago
Loading a Sound buffer and playing it is easy, but how do you properly check if data is loaded in a sound buffer?

Is it safe do this...

if(lpDSBuffer1 != NULL) lpDSBuffer1->Play(0,0,0);

Thats how I am doing it, but think sometimes the lpDSBuffer1 has no data but the object contains a value other than NULL, causing my app to hang the whole system.

Also...does the buffer lose its data completely when it returns BUFFERLOST, requiring you to reload the wave file, or can you easily recover the data by using ->restore?


  Downloads:  ZeroOne Realm

Advertisement
as with all objects in directx, you check the return value for success or failure.

no, Restore() will NOT restore the data you had in your buffer. it will only reallocate the space your buffer occupied.

Get off my lawn!

This topic is closed to new replies.

Advertisement