Jump to content
  • Advertisement
Sign in to follow this  

Effects in Direct Sound 8 using native C++

This topic is 2646 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; \

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

// Write a list of effects
EffectCount = 0;

// 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);

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#.
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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!