Re: [AD] sound and more sound

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


Javier González <xaviergonz@xxxxxxxxxx> wrote:
> I was wondering
> why does allegro uses unsigned data for 16 bit samples? the "most standard"
> is signed for 16bit and unsigned for 8bit

I guess for consistency.  As the manual says, "The sample data is
always in unsigned format".  It's too late to change now anyway.

> because of that, i must add 32768 to each frame of a mp3 in order to play
> it...

Easier is to flip the top bit, i.e. sample[i] ^= 0x8000;

-- 
tjaden@xxxxxxxxxx - http://www.psynet.net/tjaden/
SPIROBITS (SPY ro bits), n.  The frayed bits of left-behind paper in a
spiral notebook.  -- Rich Hall, "Sniglets"



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