audiococos2d-iphonerangevolumesimpleaudioengine

is it safe to use out of bounds SimpleAudioEngine volume ranges?


Ive couple of lines.
2nd line is documented.
1st line is out of bounds somehow it really works.

Albeit documentation and other QA's says that range is 0f to 1f :
on higher volume something like 20, 30; really increases volume of sound effects.so it works.

is it normal ? or maybe a bug ? is it riscy maybe if I use out of bounds given in documentation ? eg:setEffectsVolume:15f instead of range 0f-1f ?

    //this is undocumented also out of bounds,somehow really increases volume to 6x.
    1. [SimpleAudioEngine sharedEngine].effectsVolume=6.0f;

    //this is normal because inbounds of range
    2. [SimpleAudioEngine sharedEngine].effectsVolume=.2;

Solution

  • The worst that can (and will) happen is a degradation in audio quality.

    Volume level 1.0f means the effect is played at the volume it was recorded (respectively digitally stored). Everything above that makes the sound play louder, but amplifies distortion. Think of this as scaling an image, you'll notice it will lose detail the further you zoom in. That's the same effect.