aifc2wav - an aifc (ima4, sowt or sdx2) to wav translator

Note: (2010-03-17) the following patch to apply to libsndfile may be used to decode CAF/IMA4 files. (I received several requests for this format not handled by aifc2wav.)

So if aifc2wav fails, just download libsndfile, patch it, and I don't know, compile sox to use the new libsndfile. Igor Korolkov from Ukraine told me it works. (If you are lucky, libsndfile already incorporates the patch at the time you read this. If not, note that people behind libsndfile asked me to provide many examples of CAF/IMA4 files, but I could not do it, so that's why the patch is not in libsndfile yet. So, if you can make several CAF/IMA4 files, contact them. By many, I mean different bitrates, 8b/16b, mono/stereo, and so on.)

diff -r libsndfile-1.0.20-vanilla/src/caf.c libsndfile-1.0.20/src/caf.c
> /* CAF/IMA4 defines. */
> #define CAF_IMA4_BLOCK_LEN				34
> 					error = aiff_ima_init (psf, CAF_IMA4_BLOCK_LEN, CAF_IMA4_SAMPLES_PER_BLOCK) ;
> 					break ;
> 	if (desc->fmt_id == ima4_MARKER)
> 	{
> 		psf->bytewidth = 0 ;
> 		return format | SF_FORMAT_IMA_ADPCM ;
> 		} ;
diff -r libsndfile-1.0.20-vanilla/src/ima_adpcm.c libsndfile-1.0.20/src/ima_adpcm.c
> 		case SF_FORMAT_CAF :


I made this little piece of software, because I wanted to listen to some khoomei music (23 Jul 2005: link appears to be dead), and some of those AIFC files were not handled by sox, nor xmms, nor mplayer. Those files were in AIFC IMA4 format.

So, I looked for information, and I found this:

I absolutely needed those files, you know, this was some matter of life or death. So I kicked some code.


It is released in the public domain.

Binary version

Den made a Windows version (Win32) of aifc2wav-5. Get it at

Alternate version

Mike Tolly (aka onyxite) sent me an email detailing some modifications he did (2013-06-24).

Not much time to anaylse it, so I release it as an alternate version. I think it can be seen as the "official" current version though.

aifc2wav-5.1.c.gz is the result of his work.

How to use it?

Unzip the C file with gunzip.

You will need a C compiler (gcc is fine). Simply compile it (for instance gcc -o aifc2wav aifc2wav-5.c), and you are done.

It handles AIFC IMA4 files, AIFC SOWT files and AIFC SDX2 files, both mono and stereo (not sure for SDX2). The SOWT scheme has not been widely tested, if your file sounds strange, contact me. (Same for SDX2.)

It will produce a WAV file. Why WAV? Because WAV files are handled by almost everyone. If you want raw data, you can skip the 44 bytes long header (something like dd if=INPUT_FILE of=OUTPUT_FILE bs=44 skip=1 under unix). Or use sox, which is a good program.

It is supposed to work on any machine, little/big endian. The only problem that might appear is because of this silly 80 bits extended float used by those silly coders. Who needs that much precision for a frequency? Well, so they did, so they did. I don't know if I handle this correctly or not.

If it does not work, then it is a bug. Contact me so I can fix it (or send a fix to be included in a future version).


Creation time: Wed, 22 Jan 2003 22:30:37 +0100
Last update: Wed, 26 Jun 2013 11:49:42 +0200

Powered by a human brain, best viewed with your eyes (or your fingers if you are blind).