Sign in to follow this  

Effects in Direct Sound 8 using native C++

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[i].SecondaryBuffer->SetFX(0,NULL,NULL);
} else {
hr = SoundCollection[i].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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this