Sign in to follow this  
Dawoodoz

Effects in Direct Sound 8 using native C++

Recommended Posts

Dawoodoz    461
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.
[code]
#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[i].SecondaryBuffer->SetFX(0,NULL,NULL);
} else {
hr = SoundCollection[i].SecondaryBuffer->SetFX(EffectCount,EffectDescs,Results);
ReadErrorCodes(hr,Results)
}
}
[/code]
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#.
[url="http://msdn.microsoft.com/en-us/library/bb318949%28v=vs.85%29.aspx"]http://msdn.microsof...v=vs.85%29.aspx[/url]
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