8
votes

I need to find the codec of an audio file. How can I do this?

Do I need to write code to do this or is there a simpler way?

Please help me. If possible share helpful links.

3
OS/language? if a general question try G-SPOT; headbands.com/gspotAlex K.
You could try gspot.alexg

3 Answers

12
votes

The good old file utility will reveal lots of information about audio files, sometimes including the codec:

$ file X.wav 
X.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 16000 Hz
5
votes

@bhebsquines

"It is important to distinguish between a file format and an audio codec. A codec performs the encoding and decoding of the raw audio data while the data itself is stored in a file with a specific audio file format. Although most audio file formats support only one type of audio data (created with an audio coder), a multimedia container format (as Matroska or AVI) may support multiple types of audio and video data." - http://en.wikipedia.org/wiki/Audio_file_format

The application gspot does a good job of pulling codecs from audio and video files.

http://www.headbands.com/gspot/

run it and drag a file into the window. It will pull all of the data from there. Note that some audio files will not display a codec as they are made from "Raw" audio.

-6
votes

You can identify your codec by extenion name itself example file1audio.mp3 or fileaudio.avi, .mp3, .avi will be your file type or codec, you can use k-lite codec pack for your different type audio format. use this link http://www.free-codecs.com/download/k_lite_codec_pack.htm