Pergunta

I work on an audio Importer in JAVA (used in a drum sequencer) and I have the following problem with importing AIFF files:

I have 2 AIFF files of the same type (24bit, 44100kHz, mono), one is created on a Mac, the other is created with wavelab on a windows computer. Both files are uncompressed PCM, both are FORM == AIFF.

The AIFF from the Mac is BigEndian (as it should be), the AIFF from Wavelab (windows) is LittleEndian.

Both files can be played back properly in Wavelab (Windows) as well as in Quicktime (Windows). How can these tools detect the endianness of these files? In any way it must be possible, otherwise at least one of the files would sound just like noise (that's what happen in my application).

Is there some hidden information within the file header or any other way to determine the endianness of the AIFF file? Any suggestions?

Thanks a lot

Foi útil?

Solução

A quick googling says, AIFF files are big endian.

However according to Wikipedia there is another format called AIFF-C that compresses data. Apple uses little endian these days and created a fake compression method named sowt that essentially means "no compression but little endian". You might have to check for that.

Apart from that, plain AIFF provides no way to check for endianness. A standard AIFF that is encoded in little endian seems to violate the specification.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top