Skip to content Skip to sidebar Skip to footer

Android Recorded Aac(.mp3) File Not Playing In Ios

Hi I'm using the following code to record audio on Android myRecorder = new MediaRecorder(); myRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); myRecorder.setOutputFormat(M

Solution 1:

i got solution just changed extension to .m4a it work on ios

let audioFilename = getDocumentsDirectory().stringByAppendingPathComponent("voice.m4a")
let audioURL =NSURL(fileURLWithPath: audioFilename)
do
 {
   audioPlayer =tryAVAudioPlayer(contentsOfURL: audioURL)
   audioPlayer.delegate =self
   audioPlayer.play()
 }
catch{
   print("filenotfound")
}

Solution 2:

myRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); suggests you should have been writing to mp4 (m4a). Not sure aac can be written to mp3 container

Solution 3:

check if you can play that file in safari of iPhone. and can you tell how are you trying to play that file?

Post a Comment for "Android Recorded Aac(.mp3) File Not Playing In Ios"