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

[Android ]Ask for permission to record before initialize #12

Open
Merwan1010 opened this issue Nov 3, 2021 · 0 comments
Open

[Android ]Ask for permission to record before initialize #12

Merwan1010 opened this issue Nov 3, 2021 · 0 comments

Comments

@Merwan1010
Copy link

If you encounter the following error when starting the record :

startRecording() called on an uninitialized AudioRecord

Please make sure to wait for the permission to record before initialize.

  await PermissionsAndroid.requestMultiple([
    PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
  ]);

  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
  }

  LiveAudioStream.init(options);

Would it be possible to edit the readme.md ?

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

1 participant