How can I get the properties of an audio file (like the number of channels, sample rate and bit rate) programmatically in Objective-C for iOS?
Asked
Active
Viewed 1,986 times
1
-
What kind of audio file? – Sam Dufel Feb 08 '11 at 05:18
-
it can be any audio file[Compressed, Uncompressed].. for example "sample.wav" or "sample.mp3" audio file – suse Feb 08 '11 at 05:38
1 Answers
1
To get the properties for any audio filetype that is supported on iOS, load the audio data into an AVAudioPlayer
and examine its properties (in particular, the settings
dictionary).

一二三
- 21,059
- 11
- 65
- 74
-
Can this be used to read audio from the ipod library? looks like ony the AVPlayer class can be used for that. If I use AVAudioPlayer I can't play the file or get anything from the settings dictionary. – roocell Oct 08 '11 at 15:16