react-native-audio-recorder-player icon indicating copy to clipboard operation
react-native-audio-recorder-player copied to clipboard

Setting recorder to AAC on iOS results in M4A file

Open gavrichards opened this issue 4 years ago • 6 comments

Version of react-native-audio-recorder-player

3.1.2

Version of React Native

0.64.2

Platforms you faced the error (IOS or Android or both?)

iOS

Expected behavior

File recorded has mime type audio/aac

Actual behavior

File recorded has mime type audio/x-m4a

Steps to reproduce the behavior

const audioSet = {
  AVFormatIDKeyIOS: AVEncodingOption.aac,
};

const uri = await player.startRecorder(null, audioSet);

Then upload the file to a server and check the media type. In this case, you get audio/x-m4a

On Android if you set AudioEncoderAndroid: AudioEncoderAndroidType.AAC then you get audio/aac as expected.

gavrichards avatar Sep 01 '21 12:09 gavrichards

@hyochan would you be able to check on this for me? I'm very keen to begin using your excellent library :) Thanks

gavrichards avatar Sep 01 '21 13:09 gavrichards

@gavrichards When aac is provided the avFormat for iOS is kAudioFormatMPEG4AAC.

Could you kindly find out the correct format for iOS if you think this is a wrong value?

hyochan avatar Sep 20 '21 17:09 hyochan

That does appear to be correct. I can't understand why it's coming through with the type audio/x-m4a, when if you use React Native Audio Toolkit, you get audio/aac as expected.

gavrichards avatar Sep 20 '21 18:09 gavrichards

same issue ?

MinaSamir11 avatar Dec 28 '22 19:12 MinaSamir11