Open harivickyhvw opened 3 years ago
Try to rebuild the project and install it again if you are running on physical devices.
I'm running into this as well unfortunately. If init is called at boot, I get the above null error, if init is called just before calling start() then it says calling on an uninitialized recorder :(
Tried rebuilding the project from android studio already as well. Great package otherwise, works awesome on ios.
Wanted to add a fix here. My issue was 2 fold,
(1) The root issue was not having microphone permissions granted.
(2) The other issue is I think the documentation has us using an out of date name for microphone permissions. The below code worked for me!
Permissions.request("android.permission.RECORD_AUDIO").then(permission => {
const options = {
sampleRate: 16000, // default 44100
channels: 1, // 1 or 2, default 1
bitsPerSample: 16, // 8 or 16, default 16
audioSource: 6, // android only (see below)
bufferSize: 4096 * 2 // default is 2048
}
AudioRecord.init(options)
AudioRecord.start()
})
Same problem :(
I am using Expo and already gave permission to record audio but still getting the same error.
[Unhandled promise rejection: TypeError: null is not an object (evaluating 'RNLiveAudioStream.init')]
I am receiving this error while trying to use this npm package, any solutions?
Thanks in advance