'how expo audio recording extension .mp3
I am using the audio component of Expo and need to export it in MP3 format。encountering such an error Error Domain=NSOSStatusErrorDomain Code=1718449215 "(null)"]
This is my code
const recording = new Audio.Recording();
await recording.prepareToRecordAsync({
isMeteringEnabled: true,
android: {
extension: '.m4a',
outputFormat: RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG_4,
audioEncoder: RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC,
sampleRate: 44100,
numberOfChannels: 2,
bitRate: 128000,
},
ios: {
extension: '.mp3',
outputFormat: Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER3,
audioQuality: Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MEDIUM,
sampleRate: 44100,
numberOfChannels: 2,
bitRate: 128000,
linearPCMBitDepth: 16,
linearPCMIsBigEndian: false,
linearPCMIsFloat: false,
},
})
Solution 1:[1]
Based on this documentation (found this link via expo docs here) iOS does not support MP3 recording.
...neither MP3 nor AAC recording is available. This is due to the high CPU overhead, and consequent battery drain, of these formats.
If you're curious about the original error, you can find more info about the corresponding native code which may have produced this error here
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | extrct |