goodatlas / react-native-audio-record

Audio record buffers for React Native (iOS and Android)
MIT License
176 stars 100 forks source link

startRecording Error of uninitialized AudioRecord Method #14

Closed montaserfzy closed 5 years ago

montaserfzy commented 5 years ago

I am trying to create audio recorder on android i faced this error

const options = { sampleRate: 16000, channels: 1, bitsPerSample: 16, audioSource: 6, wavFile: 'test.wav' } AudioRecord.init(options); AudioRecord.start();

React-native --v: 57.8

error

vinayr commented 5 years ago

@montaserfzy you need to get microphone permission before init. Take a look at example app.

fukemy commented 1 year ago
  if(recorder.getState() != AudioRecord.STATE_INITIALIZED){
            return; //avoid crash
        }