-
Magically delicious
sndPlaySound() and LockResource()
I'm using a function called PlayResource() (found in MSDN) that takes the name of a wave resource and plays it. The function does this:
FindResource();
LoadResource();
LockResource();
sndPlaySound();
FreeResource();
The sound could be potentially played very frequently and I think it would be better to just load/lock the resource once at program start then play when necessary and free on shutdown. I don't know if that's something that I should do though as I'm unfamiliar with all the ramifications of all the functions involved.
What do you think?
-
It is better, in this case, to save the resource to a temporary file (use SizeofResource to get the resource's size) and load it from there.
Popular pages
Recent additions