[Openal] Sound crackling
Daniel PEACOCK
dpeacock at creativelabs.com
Wed Apr 8 06:07:47 PDT 2009
Hi,
I'm not sure if the source code to the Apple implementation is available -
maybe someone else on the list knows.
re : looping. Every implementation should play all of the samples when
looping is enabled otherwise this will cause clicks & pops. Are you
enabling looping before playing a Source or during playback?
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
Søren
Christiansen
<sc at spanning.dk> To
Daniel PEACOCK
04/08/2009 01:33 <dpeacock at creativelabs.com>
PM cc
openal at opensource.creative.com
Subject
Re: [Openal] Sound crackling
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
> <ecblank.gif>
Sent by: To
openal-bounces <ecblank.g
@opensource.cr if>
eative.com openal at ope
nsource.cr
eative.com
04/08/2009 <ecblank.gif>
11:19 AM cc
<ecblank.g
if>
<ecblank.gif>
Subject
<ecblank.g
if>
[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
ForwardSourceID:NT0006B052
More information about the Openal
mailing list