[AD] allegro mixer trouble

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Title: allegro mixer trouble

This little program, when run, plays a sample at different volumes.
What I hear is the sample at the right volume. However, there also
is a certain amount of noise, which is heard only when the sample
plays (so it is not something which comes from the sound card, I
guess), and is not heard at such low volumes that the sound is not
heard (1 or zero volume). What I find odd with this is that when
the sample is heard, the volume of the noise stays constant, instead
of being roughly proportional to the sample volume.

I'm using 4.1.4 with no modifications in the sound area, Linux 2.2.10
and a sound blaster 16 in 8 bit mode (it doesn't work in 16 bit mode,
though I'm pretty sure it's a Creative one, not a clone).

My questions are twofold:

- is it expected and unavoidable (save for complicated calculations)
  that the noise volume does not diminish when the sample volume does
  so, or is it a bug or a slightly wrong formula in computing the
  various tables in Allegro ?

- is it because it's only 8 bit mixing, which has some precision
  issues, and 16 bit mixing sounds a lot better ?

As a side issue, if it happens that it's because of being done in
8 bit precision, I noticed that there is never any interpolation
when mixing is done in 8 bits. I was thinking that mixing could be
done in 16 bits when requested by quality==2, and only converted to
8 bits before the data is send to be played, *after* mixing. Am I
right in thinking this would substantially improve sound quality ?

Cheers

--
Vincent Penquerc'h

 

Attachment: noise.cc
Description: Binary data



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/