Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Setting volume to 0 still produces sound

conqueran
Registered User
Quote
2023-09-08 22:13:27

I didn't have this problem in linux but on windows I do. Even when I set the volume of some sounds to 0 it still makes a partial sound. Is there any way to fix this? I would assume it shouldn't make any sound at all.


conqueran
Registered User
Quote
2023-09-08 23:07:07

I tried setting the volume of the sound source instead of the sound and it worked as expected. When I set the volume of the sound that arises from the source I get problems it seems


niko
Moderator
Quote
2023-09-09 07:40:13

That's strange. Are you sure you are setting it to exact zero?


conqueran
Registered User
Quote
2023-09-09 17:44:46

I checked it to be 0.. The code I had was this below. the variable volumeSettingAdjust was set to 0.


void Sound::soundPlay( ISoundSource * source, float volume, float playBackSpeed )
{
const float furtherAdjust = 0.3f;

ISound * sound = soundEngine->play2D( source, false, false, true, false );
if( sound )
{
sound->setVolume( volume * volumeSettingAdjust * furtherAdjust );
sound->setPlaybackSpeed( playBackSpeed );
}

sounds.push_back( sound );
}



Even when setting the volume to 0 sound is still produced.. The sound seems to only lower the volume of some aspects of the wav file but some parts are still noticeable loud. For some wav files its noticeably worse then others. However if I comment out the sound->setVolume and replace it with source->setDefaultVolume it works as expected


void Sound::soundPlay( ISoundSource * source, float volume, float playBackSpeed )
{
const float furtherAdjust = 0.3f;
source->setDefaultVolume(volume * volumeSettingAdjust * furtherAdjust );

ISound * sound = soundEngine->play2D( source, false, false, true, false );
if( sound )
{
sound->setPlaybackSpeed( playBackSpeed );
}

sounds.push_back( sound );
}


works as expected


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (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