Jim
2008-03-24 23:26:03 UTC
I'm using Directsound to play two wavs. Sound 1 is a looped wav and is run
with the looped flag set in Play(). Sound 2 is a sound that lasts about a
second and isn't looped. Sound 1 turns off asynchronously via a button
control (using Stop()). The next occurrance of sound 1 after sound 2 is
turned off has a loud unwanted pop that happens at the beginning of it.
I've tried everything I can think of and have started shooting in the dark.
Set the play position in the buffers to zero when turning sound 1 off,
polling sound 1 and waiting to turn it off until it's at a place I know is a
zero crossing. I even tried releasing all the buffers and then
reinitializing everything after turning sound 1 off, but still get the pop
that goes along with the next occurrance of sound 2. How to fix? At least
one demo I've seen of how to use Directsound also has a similar problem.
with the looped flag set in Play(). Sound 2 is a sound that lasts about a
second and isn't looped. Sound 1 turns off asynchronously via a button
control (using Stop()). The next occurrance of sound 1 after sound 2 is
turned off has a loud unwanted pop that happens at the beginning of it.
I've tried everything I can think of and have started shooting in the dark.
Set the play position in the buffers to zero when turning sound 1 off,
polling sound 1 and waiting to turn it off until it's at a place I know is a
zero crossing. I even tried releasing all the buffers and then
reinitializing everything after turning sound 1 off, but still get the pop
that goes along with the next occurrance of sound 2. How to fix? At least
one demo I've seen of how to use Directsound also has a similar problem.