Open Pitch

Can someone tell me why the volume gets lower when I take a step higher in openal? The higher the pitch, the lower the volume .....

alSourcef (source, AL_PITCH, 1.2f); alSourcef (source, AL_GAIN, 1.0f);

with this setting, the volume is still very low. is there any way to fool him to get a win above 1? Maybe this has something to do with distance?

FYI, the source is the voice recorded from AVrecorder, so I can’t set the source volume higher.

+4
source share
1 answer

Afaik is not normal, that the amplitude will change depending on the change in pitch. When the step is set above the original, openal speeds up sampling by a factor (afaik), using some interpolation when the multiplier is not integer.

There may be some rare cases where the amplitude changes, but probably not for longer samples with a lot of frequency content (as is usually the case with most natural sounds)

How loud we perceive that the amplitude depends on the pitch, see equal volume contour
Maybe this effect explains your question?

As a workaround, you can lower the gain for regular sounds and use a higher gain for higher sounds.
Or multiply the source data by a factor before attaching / passing to the buffer.

+3
source

All Articles