Search code examples
c++audioencodingmetadatatype-signature

Get encoding of audio track


Suppose I have .3g2 file. I noticed, they can contain audio track of different encoding (AAC, AMR).

Or, for example, an .m4a file can contain (AAC or ALAC) encoded audio track.

MediaInfo detects it pretty well, but I want to be able to do that using C++.

My question is, how can I detect the type of the audio track in a media file?

Thanks.


Solution

  • MediaInfo is also available with a C++ interface, just download MediaInfo library package, and here is a C++ example.

    For getting the first audio track format: MediaInfo::Get(Stream_Audio, 0, "Format")