Re: [linux-audio-dev] 22050hz mono volume fading

From: Sampo Savolainen <v2@email-addr-hidden>
Date: Sun Oct 23 2005 - 14:42:07 EEST

On Sun, 2005-10-23 at 22:55 +1300, Ross Levis wrote:
> It's my first post here. I'm developing an audio player which has a
> fading
> up/down facility. This is working fine except for 22050 mono samples.
> I'm getting patchy loud noises (intermittent white noise?) while fading
> the audio data up and down. The original audio can also be heard
> between the noise.
>
> The basic equation I'm doing is (Excuse the Pascal syntax):
>
> Data := Data * CurrVol / 32767;

Does CurrVol move gradually from one gain to another gain?

If you do a fast gain change, say from 1.0 => 2.0 without gradually
moving the gain from the start value to the next value, you will get an
horrible transient. Doing a fast gradual change from the first value to
the next one is called declicking.

Consider two samples, first at 0.5 and the next one at 0.51. If the
gain is changed from 1.0 to 2.0 between these samples without
declicking, the first sample will be 0.5 and the next one will be 1.02.
You can just imagine what this non-continuity will sound like when it
gets through your DAC. This will be even worse if you change the gain
from 0.0 (-inf) to 1.0.

-- 
Sampo Savolainen <v2@email-addr-hidden>
Received on Sun Oct 23 16:15:11 2005

This archive was generated by hypermail 2.1.8 : Sun Oct 23 2005 - 16:15:11 EEST