[Openal]Popping noise problem
Hao Zhou
frankmail007 at yahoo.com
Mon Aug 3 22:12:08 PDT 2009
I'm using OpenAL in a few my projects for iPhone becuase it's portable and easy to use. But the popping noise problem puzzled my for quite long time although I managed to by pass the problem by some tricks in some of my project. I'm here agina to seek for a decent solution.
My problem is I always get popping noise when I'm trying to stop a source which is still playing. I tried to adjust the gain to 0 or move the source very far or even move the offset to the end of the buffer, the problem can't be solved. ( There is about 10ms silence at the end of the sound file).
Then I tried to create a timer when I'm going t stop a source. The gain of this source will be reduced gradually to near 0, for example 0.0001 and then I move the offset to the end of the buffer. The popping sound will not exist any more this time. However this is not the perfect solution because it takes time to stop a source. In my case it'll take about 500ms to stop a source. That means this source can't be reused within this duration. That limits the maximum number of sources at the same time. I'm not sure what is the maximum number of sources can be used in iPhone. Smebody told me it's 32. That means there are at most 32 sources can be used within 500ms which leads to problem in my new project. My new project only need at most 12 to 16 sources at the same time. But due to the popping noise problem, it will easily use more than 32 sources.
Can anybody advise what should I do to overcome this problem? Or I should use some other audio library? ( I tried AudioUnit, it's perfect to meet my requirement but it's not portable.)
Thanks,
Frank
More information about the Openal
mailing list