Search code examples
androidioscordovaaudio-recordingplayback

What format should I record in android to play in ios


Im building an application where Im using cordova media to record audio on both ios and android. I encode the audio to a base64 string and send it to a server (parse.com) and save it as a file. When I want to play it, I play the url from the file after I click on a button on the devices. When I record the audio as a wav file on ios I can play it on both ios and android. But when I record on android I can only play it back on android devices.

Im struggling to find a format which I can record on android and play it on ios. I have tried wav, mp3, mp4, aac and 3gp. I have tried amr as well, but then it looks like it download the file to the phone and that is not what I want to do.

Can someone please help, Im really lost here.


Solution

  • Here's what I used. It plays audio properly in iOS.

        recorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT);
        recorder.setAudioSamplingRate(44100);
        recorder.setAudioEncodingBitRate(96000);
        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);