Is OpenAL setting AL_PITCH and AL_GAIN expensive?

Whenever I play a sound effect, I use:

alSourcei (sources [index], AL_BUFFER, 0);
alSourcei (sources [index], AL_BUFFER, bufferID);
alSourcef (sources [index], AL_PITCH, 1.0);
alSourcef (sources [index], AL_GAIN, 1.0);

will significant optimization remove the AL_PITCH and AL_GAIN settings each time the sound effect is played? Obviously, since they are 1.0 every time I could just install it once when I initialize the sound. What are the default values ​​AL_PITCH and AL_GAIN if they are not set?

+5
source share
1 answer

" ", , , , OpenAL. , , .

alSourcei/alSourcef , , GetContextSuspended, / , switch , , , , , , TLB).

alSourcei / node , - malloc .

AL_GAIN AL_PITCH . , , , - . , , alSourcef .

alSourcef, , , , , , - , 1.0, , .
... , , , ( ).

+8

All Articles