OpenAL pops when setting gain.
I've been having a problem with OpenAL. It seems that changing the gain on a source is ramped over time. I can live with that, it just means that I have to create and destroy sources instead of reusing them. Unfortunately, even brand new sources seem to have the same problem as if they are being reused internally.
As a test, I played a bunch of sounds with a brand new source every time a sound is played. Most of the sounds have a nearly 0.0 gain so that they are barely audible, then occasionally I play a sound with a gain of 1.0. Every time after the loud sound is played, the next quiet sound has a loud pop at the beginning as the volume is quickly ramped down.
I've tried forcibly flushing the gain setting by setting the null buffer, stopping it while it's still AL_INITIAL, and a number of other things, but the problem won't go away.
Any ideas other than changing the volume of the sound files themselves and always using a gain of 1.0?
As a test, I played a bunch of sounds with a brand new source every time a sound is played. Most of the sounds have a nearly 0.0 gain so that they are barely audible, then occasionally I play a sound with a gain of 1.0. Every time after the loud sound is played, the next quiet sound has a loud pop at the beginning as the volume is quickly ramped down.
I've tried forcibly flushing the gain setting by setting the null buffer, stopping it while it's still AL_INITIAL, and a number of other things, but the problem won't go away.
Any ideas other than changing the volume of the sound files themselves and always using a gain of 1.0?
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
I have this same problem. I gave up trying to adjust individual gain. I resorted to adjusting my raw audio files' levels by comparing all sounds against each other in GarageBand and saving them out like that [and using gain of 1.0]. Sucks.
I gave up trying to adjust gain on-the-fly due to similar weirdness. For 2D sound however, you can adjust a source's Z position to control the volume - worked much better for me anyway.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Setting Far Cut Off | Nick | 2 | 2,227 |
Sep 7, 2004 05:57 PM Last Post: Nick |
|
| Setting up SDL on Mac OS X | -Rice- | 5 | 4,227 |
Mar 10, 2003 08:16 PM Last Post: Feanor |
|

