
HELP: when is a .wav done playing?
Quote:
>ok, i know how to play a wav using API calls, but how can i find out if a
>wav is done playing? i'm trying to sync animation to sound, and i want the
>animation to stop when the sound stops.
I'm sure this is not the proper way to do it, but I think it'll work...
Using the sndPlaySound options listed below (posted earlier by someone else)
you could start you sound and then in your animation loop call sndPlaySound
with the
SND_NOSTOP and a bogus file name. If the call returns false, your sound is
still playing. Worth a try anyway.
SND_SYNC Played synchronously and the function does not
return until the sound ends.
SND_ASYNC Played asynchronously and the function returns
immediately after beginning the sound.
SND_NODEFAULT If the sound cannot be found, the function returns
silently without playing the default sound.
SND_LOOP The sound will continue to play repeatedly until
sndPlaySound is called again with the lpszSoundName$
parameter set to null. You must also specify the
SND_ASYNC flag to loop sounds.
SND_NOSTOP If a sound is playing, the function will immediately
return False without playing the requested sound.