How to play AMR audio file on iPhone

Ansh picture Ansh · Dec 14, 2011 · Viewed 12.4k times · Source

I have tried using AVAudioPlayer , MPMoviePlayer to play AMR files but unable to play them. AVAudioPlayer play method always returns NO for AMR files and MPMoveiPlayer post MPMoviePlayerPlaybackDidFinishNotification as soon as it is played. Even tried to play play AMR with webview but without success.

Is there any other way to play AMR files. According to this post About AMR audio file playing issue on different devices iOS4.3 above does not support AMR ,but how can mail app can play AMR files?

I tried converting AMR to caf file using ExtAudioFile ,but I am getting an error code 1718449215 which I found out that it means kAudioFormatUnsupportedDataFormatError.

Answer

Harry Ng picture Harry Ng · Oct 2, 2013

Even it is an old question, I still do not have an answer.

Instead, my way is converting to wave in advance, with the use of the following library from Github

https://github.com/justinjing/RecordWAVToAMRDemo/blob/master/AmrConvertAndRecord/VoiceConvert/VoiceConverter.mm