[Openal] Sound crackling

Søren Christiansen sc at spanning.dk
Wed Apr 8 05:33:06 PDT 2009


Thank you so much! It makes sense and also supports my testing  
results ... decreasing the volume steps pr. frame/loop decreases the  
crackling. Is it possible to get the implementation details for the  
different AL devices somewhere (preferably apples openal impl)? I have  
a different problem, maybe related to the same as above: Sometimes  
when I loop audio, some of the the samples are simply cut away!. I can  
imagine that it has something to do with buffer boundaries (which  
differ from hw to hw)? or?

thx again,



On Apr 8, 2009, at 1:36 PM, Daniel PEACOCK wrote:

> AL devices are all implemented differently ... but most of them will  
> not commit 100 volume levels per second on a Source especially the  
> software based ones. Most software mixers operate by mixing a block  
> of audio at regular intervals and use the currently set parameters  
> at that time to control the mixing. These blocks can be different  
> durations but could be of the order of 25 milliseconds in duration  
> (meaning 40 updates per second). Some AL devices will do parameter  
> ramping to reduce artifacts due to sudden changes in level from one  
> mixing interval to the next, but some may not (it is a performance  
> vs quality trade-off).
>
> The popping & clicking is possibly occurring due to large changes in  
> volume level. This is in part being caused by the use of a linear  
> volume fade. You may get better results if you use a different type  
> of fade, eg...
>
> // called 100 pr sec
> float flInc = (PI / (2.f * 100.f)); // 100 steps from 0 to PI/2
> float flFade = 0.0f;
> // fade in from silence to full volume in 100 steps
> void Update()
> {
> flFade += flInc;
> alSourcef(id, AL_GAIN, 1.0f - cos(flFade));	
> }
>
> Dan
> Creative Labs (UK) Ltd.
>
> Notice
> The information in this message is confidential and may be legally  
> privileged. It is intended solely for the addressee. Access to this  
> message by anyone else is unauthorized. If you are not the intended  
> recipient, any disclosure, copying or distribution of the message,  
> or any action taken by you in reliance on it, is prohibited and may  
> be unlawful. If you have received this message in error, please  
> delete it and contact the sender immediately. Thank you.
>
> Creative Labs UK Ltd company number 2658256 registered in England  
> and Wales at Belmont Road, Belmont Place, Maidenhead, Berkshire, SL6  
> 6TB
>
> <graycol.gif>Søren Christiansen <sc at spanning.dk>
>
>
> Søren Christiansen <sc at spanning.dk>
> Sent by: openal-bounces at opensource.creative.com
> 04/08/2009 11:19 AM
>
> <ecblank.gif>
> To
> <ecblank.gif>
> openal at opensource.creative.com
> <ecblank.gif>
> cc
> <ecblank.gif>
> <ecblank.gif>
> Subject
> <ecblank.gif>
> [Openal] Sound crackling
> <ecblank.gif>	<ecblank.gif>
>
> Hi all,
> I'm encountering crackles and pops if I change the source.volume
> frequently like this (pseudo code):
>
> // called 100 pr sec
> void Update()
> {
> read out [volume]
> alSourcef(id, AL_GAIN, [volume] + 0.01);	
> }
>
> Is this expected and/or can I do something to prevent it?
> Im on a intel macbook pro.
>
> cheers,
>
> Søren C.
>
>
> _______________________________________________
> Openal mailing list
> Openal at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal
>
> ForwardSourceID:NT0006B042

-------------- next part --------------
Skipped content of type multipart/related


More information about the Openal mailing list