views:

30

answers:

1

I need to determine how many channels a sound track has in a QuickTime movie. I can get to the track, then I am stuck. I wonder if the answer would be in a QTFormatDescription, but I can't figure out how to get one for the track. I am using Objective-C on Mac OS 10.6.

A: 

You need to find the Sample Table Atom for that Track, then find Sample Description Atom in Sample Table Atom, then find the Sound Sample Description Atom that describes the Track's samples. In it you'll find a 16-bit Number of channels field that contains what you need.

You can read about this in detail in the Quick Time File Format specification HERE - on page 134.

EDIT:

File is written in Network Byte Order, and you need to convert the 16bit value that you will read to Host Byte Order. To do so, in .NET for example call IPAddress.NetworkToHostOrder().

Cipi