Audio recorded using Samsung cannot be played on iOS

I am developing an audio application that allows you to record micro to mp3 file. Then it allows you to play the audio file. On Android, I use this code:

mRecorder = new MediaRecorder(); mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC); mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC); mRecorder.setOutputFile("path/audio.mp3"); try { mRecorder.prepare(); mRecorder.start(); } catch (Exception e) { LogUtil.e("startRecording", e.getMessage()); } 

I can play recorded sound on iOS if my application runs on a Nexus 5 device, but I cannot if I worked on Samsung S3 / S5.

Sorry for my poor English, if you cannot understand the description well, please check the following amount:

  • Audio recorded above with Nexus 5 => code can play on iOS
  • Audio recorded above with Samsung S3 / S5 => cannot play on iOS

How to play sound recorded by Samsung devices on iOS? Please help me.

+5
source share
1 answer

If you want to play these files using streaming, you can go through my answer. There is metadata in the audio file that allows this stream, in some devices like samsung, this is the end of the file. You need to move this metadata to the top of the file to make the file more flexible. You can use MP4Box for this.

-1
source

All Articles