Question

I have tried so many different formats when I record a audio on android, that I get dizzy by just thinking about it. When I record by using .wav on ios, I can play it on android without any problem. But Im not able to play the recorded audio from a android on a ios.

I have tried to play it as a base64 and streaming by using the url. I don't know what to do play it, since nothing seems to work. But if some one just can point me in the right direction when it comes to what format I should use to record the audio on android so I can play it on ios, I would be very greatfull.

What I have so far:

       recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
   recorder.setAudioSamplingRate(44100);
   recorder.setAudioEncodingBitRate(96000);
   recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
   recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);

but I got no idea what I should name the file I record on (like this record.mp3). Im using cordova so I have to do it when I start the recording. I have tried mp4, m4v, m4a, mp4, mp4, mpeg4 and mpeg. I have tried to record the file as a wav file as well, but then I get audio/x-wav in my base64 string.. Do I need to change the samplingRate, bitrate, outputformat or audio encoder to something else if I want to use .wav (not x-wav) and still make it work on ios?

Was it helpful?

Solution

After googling this issue, it seems even the very popular app "Evernote" has the same issue, and users are gutted about it. I did come across this question here on SO:

audio format for iOS and Android

They use a web service to convert the files to mp3, which works universally. I am sure you could find some way to do this without a middle man, but it should "point you in the right direction".

Hope this helps.

Cheers

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top