Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Unhandled promise rejection: TypeError: null is not an object (evaluating 'RNLiveAudioStream.init')] #2

Open
harivickyhvw opened this issue Aug 1, 2020 · 5 comments

Comments

@harivickyhvw
Copy link

[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

@xiqi
Copy link
Owner

xiqi commented Aug 1, 2020

Try to rebuild the project and install it again if you are running on physical devices.

@dorthwein
Copy link

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.

@dorthwein
Copy link

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()
    })

@morqxecho-string
Copy link

Same problem :(

@tayyab-tariq
Copy link

I am using Expo and already gave permission to record audio but still getting the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants