Re: [AD] Sound API |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Ben Davis wrote:
That would be a pretty scary curve. All normal audio would be in a tight little 'band' (to misuse a term) with an evil DC offset, until it clips and then it would jump all the way up to the top :)For 16-bit mixing, it'll be 0,0,0,...,0,0,0,16,32,48,...,65504,65520,65535,65535,...,65535i.e. steps of 16, but covering the full range. The precision is quite bad actually. (This is with the old mixer of course.) But it does cover the full range of output volume.
Right, a closer look at the original source more or less confirmed something like this. Still, each voice itself gets clamped to 14-bit (or 15-bit if you use set_volume_per_voice(0)), which leaves very few voices before the mixer buffer wraps. And it still should be considered 14-bit, since 8-bit audio covers the full audio range but only has 256 levels, and Allegro's original only contains 16384 levels with the rest being set to max and mix.
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),Default? Default for what?
Default volume level. Where both channels added together would be full volume.
So I guess there are two issues at hand: whether the output is the same when set_volume_per_voice() is called, and whether it's the same when set_volume_per_voice() ISN'T called.When set_volume_per_voice() isn't called:Is the default level the same? I don't think it would be wise to up it, since games are relying on it. Back when I implemented set_volume_per_voice(), I almost did change the default behaviour, but people didn't like it.
Well, the problem I see is when you implemented set_volume_per_voice, you couldn't change the default, or else you still risked overflow and wrap-distortion (you only had protection for 4 voices; anymore risked wrapping the buffer). My changes however, gives 255-voice overflow protection, and since Allegro only provides 64 maximum output voices there's no logical way that limit can be reached (whereas when set_volume_per_voice was put in it was still very easy to reach the clip table's limit) in existing programs.
- Kitty Cat
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |