views:

334

answers:

2

Is there a way to programmatically convert and/or encode to AAC/m4a format in Cocoa without the use of any libraries or programs that don't ship with Mac OS X?

I don't want to use for example, faac or ffmpeg, to do the encoding.

+3  A: 

Look at QTKit.

Warren Young
+2  A: 

The other way would be Core Audio. A really simple way would be the afconvert command line tool, which you could invoke using NSTask. On the other hand, using Core Audio's API directly may enable you to report progress to the user.

Peter Hosey
+1; another nice thing about afconvert is that (IIRC) it's part of Mac OS X (or XCode, but considering this is Stack Overflow you probably have that, too).
fbrereto
I don't think afconvert is part of the Xcode distribution—which is a good thing, because if it were, users of the questioner's app would need to have Xcode installed to convert audio with it.
Peter Hosey
It's easy enough to check that: pkgutil --file-info /usr/bin/afconvert. (and yes, it's part of the base OS).
Nicholas Riley