Hi I'm using following setting to record in swift
let audioFilename = getDocumentsDirectory().stringByAppendingPathComponent("recording.m4a")
let audioURL = NSURL(fileURLWithPath: audioFilename)
let settings = [
AVFormatIDKey: Int(kAudioFormatMPEG4AAC),
AVSampleRateKey: 44100.0,
AVNumberOfChannelsKey: 2 as NSNumber,
AVLinearPCMBitDepthKey: 16 as NSNumber,
AVLinearPCMIsBigEndianKey: false as NSNumber,
AVLinearPCMIsFloatKey: false as NSNumber,
AVEncoderAudioQualityKey: AVAudioQuality.High.rawValue
]
but that m4a file not play on android
mediaPlayerAdd = MediaPlayer.create(AndroidPlayerActivity.this, R.raw.recording);
mediaPlayerAdd.prepare();
mediaPlayerAdd.start();
no error and not playing. How to play this file in android any conversion needed