Finding Codec in audio file using Apple APIs

216 Views Asked by At

Is there a way to find the codec/container of an audio file using Apple APIs (AudioToolbox or Quicktime)?

1

There are 1 best solutions below

3
On

You can practically read all possible information from a QuickTime movie using its internal movie atoms.

What you need is the "Sample Description Atom" of the sound track. You can find further information here : http://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-75770

As can be seen, there are certain values defined for many kinds of different audio file formats. These QT Atoms are a bit tough to understand at first, but this is basically the way to go to retrieve all information necessary.

There is a tool by Apple called the "Atom Inspector" to give you an overview of all atoms a movie contains and their values.

Hope that helps!