Re: [AD] Sound API |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Ben Davis wrote:
On Monday 17 May 2004 01:08, Chris wrote:Allegro will never play at full volume without my patch. Remember, the clipping table will clip it to a max of 14-bit output (lest output wraps), and also the internal volume ranges were only 13 or 14-bit too.No, that's the _precision_. As I understand it, the old code used 14-bit precision but scaled the output by 4, so the volume was the same as with the new code. Are you sure there's an audible difference?
The volume is precision yes. And looking at the original code again, what I'm seeing is that 3/8ths of the 14-bit mixing range is clipped from both ends:
/* clip extremes of the sample range */ for (i=0; i<clip_size*3/8; i++) { mix_clip_table[i] = 0; mix_clip_table[clip_size-1-i] = clip_max; }clip_size is 1<<14 in 16-bit output, and 1<<10 in 8-bit output. Anything within the two extreme ranges are topped, or bottomed, out, so you'll get audio ranging from 32 to 512, then clipped to 0 and 65535 if it's not within that range (in 16-bit output). If my math is right.
And even with set_volume_per_voice(1), which would give you the default volume level (half per channel if centered, or full if panned hard to one side), it is maxed out at 14-bit before mixing into the buffer, whereas my mixer maxes it out at 24-bit (then later scaled down as needed).
- Kitty Cat
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |