Page 1 of 1

AIFF FILES

Posted: Fri Mar 23, 2018 10:31 pm
by Rebel
Maybe machf knows this. ;) I can't seem to find a straight answer as to whether or not a
file with extension .aiff is the same as .aif. I wrote a quick n' dirty drag n' drop to convert
a aiff into a pcm, but this .aif / .aiff is an unanswered question of mine. If anyone has an
opinion on this or can shed some light on the subject, be glad to hear it as I can't seem to
find one .aif file to look at.

Re: AIFF FILES

Posted: Fri Mar 23, 2018 11:29 pm
by machf
Hmmm. Well, .aiff, IIRC, is a Mac sound file extension. At the time, DOS on PCs was limited to 3-character extensions, so I guess maybe .aif is the same, after the trailing f was chopped down.

Re: AIFF FILES

Posted: Sat Mar 24, 2018 1:57 am
by Rebel
That makes sense. My one sticking point is I can't fathom how to read 10 bytes as a floating
point number and convert that into an unsigned long so I can decipher the sample rates. Who
the hell came up with it s**t?!

I know you're a math whiz, but I sure as hell am not-

Re: AIFF FILES

Posted: Sat Mar 24, 2018 4:34 am
by machf
10 bytes? What an odd choice... 80-bit floating-point numbers. Hmmm...

Well, if they all follow the same pattern, maybe you could treat them as 128-bit (16-bytes) values, filled with trailing 0s.

I know I have the file format specs lying around, from a long time ago. Bacj then when I wanted to make a mulimediaplayer that could replay .WAV and .AIFF files on a Atari 8-bit computer, I think.

EDIT: never mind, I found an archived copy of the specs at the Internet Archive...
AIFFSpecs.zip
(45.46 KiB) Downloaded 699 times
Here's some info about the "80 bit IEEE Standard 754 floating point number":
https://en.wikipedia.org/wiki/Extended_precision

And here's the ""IEEE 754 quadruple-precision binary floating-point format" for comparison:
https://en.wikipedia.org/wiki/Quadruple ... int_format

EDIT2: and aooarently, here's some conversion code icnluded:

http://muratnkonar.com/aiff/index.html

Re: AIFF FILES

Posted: Sat Mar 24, 2018 9:15 am
by Rebel
Thanks for the info machf. I'll give it a further look, maybe I can figure out how to
read those 10bytes into a long. I've seen that conversion code though, it specifies
that it 'tricks' the compiler into accepting a 10 byte buffer as an unsigned long, but
it doesn't trick it at all; won't compile. I didn't think it would -

* I was going to send you the drag n' drop code, but apparently you can't attach a
zip to a pm msg.

Re: AIFF FILES

Posted: Sat Mar 24, 2018 11:30 pm
by Rebel
Well, I couldn't figure it out, machf, so I just compared a few bytes and came up
with a dummy hack that seems to work.

I attached a drag n' drop test. I included a few .aiff files in the zip.

@Edit. I added a drag n' drop for .au (Sun/NeXT) 16 bit files (format 3). Seems
to be the only format used or bothered with by audio programs (like audacity).

@Edit2: I added a drag n' drop for .voc files (creative lab (16bit)), stereo or mono.
A few sample voc file are inside the zip as examples. Code is inside the zip too.

@Edit3: Added a drag n' drop for .htk files(HMM Toolkit (16bit stereo/mono).

Re: AIFF FILES

Posted: Fri Jun 01, 2018 2:37 pm
by Rebel
Inside the zip are two more drag n' drops. One converts 24bit .aif files into wav, and the other
converts 1bit .caf files into a wav.