• Advertisement
Sign in to follow this  

Effects in Direct Sound 8 using native C++

This topic is 2385 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Problem 1:
I have applied effects directly on played sounds just for testing and when I turn down the volume or stop the sound, the echo will also stop as if it was applied to the input.

#define AddEffect(DESCS,COUNTER,NAME) \
memset(&DESCS[COUNTER], 0, sizeof(DSEFFECTDESC)); \
DESCS[COUNTER].dwFlags = 0; \
DESCS[COUNTER].dwSize = sizeof(DSEFFECTDESC); \
DESCS[COUNTER].guidDSFXClass = NAME; \
COUNTER ++;

DWORD EffectCount;
DWORD Results[16];
DSEFFECTDESC EffectDescs[16];

// Write a list of effects
EffectCount = 0;
AddEffect(EffectDescs,EffectCount,GUID_DSFX_STANDARD_ECHO)
AddEffect(EffectDescs,EffectCount,GUID_DSFX_STANDARD_FLANGER)

// Apply them to each sound for testing
LoopForwardLengthFromZero(i,NumberOfSounds) {
if (EffectCount == 0) {
hr = SoundCollection.SecondaryBuffer->SetFX(0,NULL,NULL);
} else {
hr = SoundCollection.SecondaryBuffer->SetFX(EffectCount,EffectDescs,Results);
ReadErrorCodes(hr,Results)
}
}

I want to play all sounds into another secondary buffer that save performance and play the effects even when I stop the sounds but I can't figure out how to connect secondary buffers to each other.

Problem 2:
The example that I found for dynamically setting the effect parameters does not work with native C++ because it is written in C#.
http://msdn.microsof...v=vs.85%29.aspx
I can't find the method GetEffects in the secondary buffer and without dynamic parameters the effects are useless.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement