I'm using MS Visual C++. I play several sounds in series using the playsound function. The length of series vary--about 4 to 11 seconds. My problem is that if I play a shorter series of sounds following a longer series, after the shorter one completes then some trailing sounds from the longer series are played. It's as if the short series overwrites the beginning of the longer series but leaves anything longer in the buffer. Does anybody know how I can prevent this or clear out the sound buffer (wherever that is) before starting a new set of sounds?
I call playsound in a loop to play a series of files from a list. My playsound call looks like this:
PlaySound(FilePathName, NULL, SND_SYNC | SND_FILENAME | SND_NODEFAULT)