we're having problems sending .m4a files from android to iOS.
It seems that the file is sent correctly but, when we try to reproduce the file in iOS it says that the duration is 00:00.
Here's some code from android MediaRecorder
configuration:
MediaRecorder mediaRecorder = new MediaRecorder();
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.HE_AAC);
mediaRecorder.setAudioSamplingRate(16000);
mediaRecorder.setAudioChannels(1);
mediaRecorder.setOutputFile(fileRecordingName);
try {
mediaRecorder.prepare();
mediaRecorder.start();
}
catch (Exception e) {
e.printStackTrace();
}
And here's some code from iOS configuration:
NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init];
[recordSetting setValue:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey];
[recordSetting setValue:[NSNumber numberWithFloat:16000.0] forKey:AVSampleRateKey];
[recordSetting setValue:[NSNumber numberWithInt: 1] forKey:AVNumberOfChannelsKey];
[recordSetting setValue: [NSNumber numberWithInt: AVAudioQualityMedium] forKey:AVEncoderAudioQualityKey];
Has anyone a clue of what is going on? It seems that configurations are the same.
Solved! It was an internal error from the xcode project, refreshing it solved the problem, thanks!