RE: [AD] sound and more sound

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


> > 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.

i was just thinking ... this can be detected at load time if we use wav or
voc
files (which allegro knows about), so the data could be converted by the
loader
routine, no ?

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

or ((unsigned long*)samples)[i] ^= 0x80008000, for half the size, which will
get rid of the 16 bit prefixes. care should be taken of the last word if any
though :)

--
Lyrian



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