How can I read the properties of an audio file in

2019-06-01 19:37发布

问题:

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?

回答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).