The code I use to play my segment is this:
m_pPerformance->PlaySegmentEx(m_pSegment, 0, NULL,
DMUS_SEGF_SECONDARY, 0, 0, NULL, NULL);
The problem is I've assigned the sound to play on a mouse move where I check certain circumstances (whether the mouse cursor lies within a ball on the screen). It seems that the sound plays a few (2-3 times) before the check for the IsPlaying function kicks in. This I can hear because I've also assigned a button to play the sound. When I use the button you can hear the sound with a (relatively) low volume, playing only once. When I use the mouse move event to trigger the sound the volume is louder and a faint echo can't be distinguished. I've tried bypassing the IsPlaying method with a static bool like this:
static bool bSoundPlays = false;
...
if (m_vBalls[i].TouchInside(cursorX, cursorY, cursorSize)
&& !m_cSounds[1].IsPlaying() && !bSoundPlays) {
m_cSounds[1].Play();
bSoundPlays = true;
}
else {
bSoundPlays = false;
}
but I still get the same effect. Can anyone help me please?
edit: during the playing of one sound I want to be able to play another sound, just not the same one (same "instance").
[edited by - moucard on June 7, 2004 10:45:02 AM]
[edited by - moucard on June 7, 2004 10:45:55 AM]