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
Post a Comment for "Android Recorded Aac(.mp3) File Not Playing In Ios"