Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Sound distortion when playing effects

Anton
Guest
Quote
2013-10-01 09:39:31

Hello!

I am having issues with distorted sounds. Basically I want to use a Master, Sound and Music-volume. What I do is. I set the mastervolume by doing..
soundEngine->setSoundVolume( volume ); 

I preload my effects using this function:
void PreloadEffect( void* data, int size, const char* effectName )
{
_preloadedEffects[ effectName ] = soundEngine->addSoundSourceFromMemory( data, size, effectName, false );
}

When I play an effect I do this..
ISound* newEffect = soundEngine->play2D( _preloadedEffects[ fileName ], loop, false, true );
newEffect->setVolume( mEffectVolume );

For some reason. If mEffectVolume is anything except 1.0, the sound gets distorted and "clips". mEffectVolume goes between 0->1.0f. Anyone got any idea what might be the problem? Do I need to create new SoundSources every time I play a new effect? I was thinking maybe if I play the same sound multiple times simultaneously using this setup, setting the volume of one of them might affect the others?


Anton
Guest
Quote
2013-10-01 12:19:14

Solved it myself..

A tip for others. Make sure you start effects paused and then resume them if you want to set their volume or other settings when you play them.

Best
Anton


niko
Moderator
Quote
2013-10-02 06:16:00

Yes, that's the usual soluition, nice that you found it yourself :)


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Interna?ional" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact