From: Maxim K. <max...@gm...> - 2006-05-29 12:00:42
|
Hi all. I'm writing a tool to access uncompressed audio files (currently in wave, aiff and wave64 formats) using numarray.memmap module -- it maps the whole file to memory, then finds the waveform data region and casts it to and array of appropriate type and shape. This works pretty well for both 16-bit integer and 32-bit float data, but not for 24-bit files, since there is no Int24 data type in numarray. Is there some clever way to achieve the same goal for 24bit data without copying everything into a new 32-bit array? The typical 24bit audio file contains two interleaved channels, i.e. frames of 3bytes+3bytes, so it can be cast to (nframes,3) Int32, or (nframes,2,3) Int8 array, but this is hardly a useful representation for audio data. --Maxim |