problem with setvolume in OGGSOUND_THREADED mode

woodshow

17-03-2011 11:42:19

setting the volume 0.f before playing,but it still has sound in OGGSOUND_THREADED.
it's ok in single thread mode;

Rambus

18-03-2011 22:45:21

I have the same issue.

I also have an issue in threaded mode where debug points sometimes cause a program crash deep in dsound.dll, with no useful debugging info in the stack trace.

stickymango

19-03-2011 23:07:27

Shall investigate.

stickymango

19-03-2011 23:16:50

Which version are you using?

I just tested using the TestDemo project and it worked fine :?

woodshow

20-03-2011 12:33:16

After create the sound by invoking the creating sound API, then call setvolume to set the volume of the sound.
last I'll set the pre sound fade out and current sound fade in.The problem happening, the updateFade api's logic has bug

my version is 1.2

the updateFade's bug code like follow:

float Fadeint = fade?0.f:getVolume();
float FadeEnd = fade?1.f:0.f;

every time,i set the old sound fade out and the new sound fade in ,the new sound's volume will gain to the max volume

woodshow

21-03-2011 02:01:54

Which version are you using?

I just tested using the TestDemo project and it worked fine :?



hi,stickymango:
my version is 1.2
Could u give a copy of TestDemo.Let me check whether my code using the API right or not.
My Email addr:xiaoshulin@xpec.com.cn


Regards,
woodshow.

stickymango

21-03-2011 11:47:02

Can you post your initialisation code, there might be a bug with the sound fading, I didn't check that in my test.

stickymango

21-03-2011 12:20:44

Hi woodshow,

I've made a tweak to the volume fading so now it will use the sounds current level to fade from, and it will either fade out the sound to 0, or fade in the sound to its preset or user adjusted mMaxGain.

There will be no other options implemented for fading sounds, if you need a fade to do anything other then this you can always manually implement your own fading function.

HTH

woodshow

22-03-2011 04:21:42

Can you post your initialisation code, there might be a bug with the sound fading, I didn't check that in my test.
my init code:

Hi,stickymango:
thanks for your remind,


startFade(bool fDir,float fadeTime,FadeControl actionOnComplete)
{
mFade = true;
mFadeInitVol = fDir?0.f:mGain;
mFadeEndVol = fDir?mGain:0.f;
mFadeTimer = 0.f;
mFadeEndAction = actionOnComplete;
mFadeTime = fadeTime;
if( mFadeEndVol == 1)《-----the problem is here,mFadeEndVol is compare a const value,now I modify mFadeEndVol comparing mGain,then it works OK.
if(!isPlaying())
this->play();
}

stickymango

22-03-2011 09:29:16

Ah I missed that part, I made some changes to that function which essentially does what you have done, although I missed the comparison further down, I'll correct that, thanks.