Audio record buffers for iOS and Android.
yarn add react-native-audio-record react-native link react-native-audio-record
;const options =sampleRate: 16000 // default 44100channels: 1 // 1 or 2, default 1bitsPerSample: 16 // 8 or 16, default 16audioSource: 6 // android only (see below)wavFile: 'test.wav' // default 'audio.wav';AudioRecord;AudioRecordstart;AudioRecord;// or to get the wav file pathaudioFile = await AudioRecord;AudioRecord;
audioSource use one of the constant values from here. Default value is 6 (
Use 3rd-party module like buffer to decode base64 data. Example -
// yarn add buffer;chunk = Buffer;
Don't forget to add microphone permission in your app.
Example folder contain sample apps for recording (using this module) and playback (using 3rd party modules)
App1.js- uses react-native-sound for playback and pause
App2.js- uses react-native-video for playback, pause and report progress
App3.js- uses react-native-audio-player-recorder for playback, pause and report progress
I'm not a native app developer. Most of the code is taken from online resources.