views:

52

answers:

2

Can anyone tell me why the volume becomes lower when I make the pitch 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 very low. is there a way to cheat it to make the gain above 1? Maybe this has something to do with distance??

FYI, the source is a voice recorded from AVrecorder, so I cant set the source volume any higher.

A: 

anyone Please??

Xiu
A: 

Afaik it is not normal that the amplitude would change in function of pitch change. When pitch is set higher than original, openal speeds up the sample by the multiplier (afaik) using some sort of interpolation when the multiplier is not whole.

There might be some rare cases where the amplitude changes, but probably not for longer samples with lots of frequency content (as most natural sounds tend to be)

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

As workaround you could lower the gain for normal pitched sounds and use higher gain for higher pitched sounds.
Or multiply the source data by a multiplier before attaching/passing to a buffer.

Emile Vrijdags
ah, I like the multiplier idea for the source data. I will look into that. Thanks Emile :)
Xiu
Thank you everybody for the help, I found setting the gain way higher than 1, such as 5, or 100 solved the low volume problem. :)
Xiu