Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16552

How do i record audio in IOS using react native, that i can upload in base64 and play on a browser/android device?

$
0
0

I've tried everything I can think of. I've tried various libraries, both react-native-sound-recorder as well as react-native-audio

Essentially what I'm doing is the following:

  1. recording voice audio on a mobile device
  2. saving it to the device filesystem
  3. reading it using react-native-fs in base64 mode or using react-native-audio with the IncludeBase64 option in the onFinished recording callback
  4. sending the base64 to an endpoint that stores the string
  5. downloading the audio base64 string from another device, either a browser or another mobile device
  6. playing said audio file back

Here are the caveats of the issue:

  1. recording on android using the above methods, storing the base64 string, and playing it back on web/android/ios works successfully using react-native-sound-recorder and these settings:
 bitRate: 128000, channels: 2, sampleRate: 44100,}if (Platform.OS === 'android') { options['format'] = SoundRecorder.FORMAT_MPEG_4 options['encoder'] = SoundRecorder.ENCODER_AAC}SoundRecorder.start(path, options)
  1. When recording audio on IOS and storing it in the server, then retrieving it and attempting to play it on either WEB or ANDROID it fails on both. It WORKS on IOS.

I'm at a loss for what I need to do differently on IOS, i've tried different formats, etc to no avail. Would love some guidance on this, ty!


Viewing all articles
Browse latest Browse all 16552

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>