Re: [AD] Speed wav loader way up

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


On Tue, April 13, 2010 7:12 pm, Peter Wang said:
> That looks right.  The overhead is from the individual al_fgetc calls,
> which have to go through the file stream vtable.
>
> The optimisation would be to read a whole buffer of 16-bit sample values into
> the buffer with a single al_fread call.  Then for #ifdef ALLEGRO_BIGENDIAN, make
> a pass over the buffer to swap the endianness.  PCM data in wave files is little
> endian, unless the identifier is "RIFX", which we apparently don't support.[1]

How's this?

Trent :{)>

Attachment: wav.diff
Description: Binary data



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