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

fons adriaensen fons.adriaensen at skynet.be
Sun Oct 23 11:14:57 UTC 2005


On Sun, Oct 23, 2005 at 10:55:49PM +1300, Ross Levis wrote:

> The basic equation I'm doing is (Excuse the Pascal syntax):
> 
> Data := Data * CurrVol / 32767;
> 
> Data is always 2 bytes of audio data (16 bit data).  CurrVol goes from 0 
> to 32767 or vice
> versa over several bytes.  If I remove this line, there is no noise 
> generated, but
> obviously no volume change either.
> 
> The problem only occurs when it's mono 22050 samples.  Stereo 22050 
> samples are fine, and mono 44100 samples are fine.

The problem is clearly not with the line you posted, but with how
it is used, i.e. in the code that loops over the samples. Or the
sample format of your mono 22k05 source is not what you think it
is. For example if its just 8 bits instead of 16 you could get
an effect similar to what you describe.

-- 
FA




More information about the Linux-audio-dev mailing list