android 16 mic issue


Problem

I am using react-native-audio-recorder-player for microphone open/close handling inside a React Native voice SDK.

On Android 16, the first microphone session works correctly, but if I rapidly start/stop the recorder multiple times, the microphone session eventually stops initializing after 2–3 cycles.

Example:

await audioRecorderPlayer.startRecorder()
await audioRecorderPlayer.stopRecorder()

await audioRecorderPlayer.startRecorder()
await audioRecorderPlayer.stopRecorder()

await audioRecorderPlayer.startRecorder() // eventually fails

Important detail

This is NOT a permission issue.

  • RECORD_AUDIO permission is already granted

  • First initialization always succeeds

  • Failure only happens after rapid repeated open/close cycles

Observed behavior

  • Reproducible on only Android 16

  • Waiting a few seconds before reopening usually fixes it

  • Looks like native audio resources are not fully released before the next initialization

  • Sometimes startRecorder() hangs or does not properly initialize after repeated cycles

Questions

  1. Has Android 16 changed AudioRecord teardown/reinitialization timing?

  2. Is react-native-audio-recorder-player known to have issues with rapid recorder restarts?

  3. Is there a recommended delay/debounce between stopRecorder() and startRecorder()?

  4. Should recorder start/stop calls be serialized to avoid native race conditions?

Current flow

const start = async () => {
  await audioRecorderPlayer.startRecorder()
}

const stop = async () => {
  await audioRecorderPlayer.stopRecorder()
}

Rapidly calling startRecorder() and stopRecorder() eventually causes microphone initialization failures on Android 16.

Has anyone faced similar issues with react-native-audio-recorder-player or AudioRecord on newer Android versions?

1
May 21 at 5:23 AM
User AvatarCode
#android#react-native

Accepted Answer

Hmm...

react-native-audio-recorder-player seems to be officially deprecated and archived, so this won't get a fix. The maintainer has moved to react-native-nitro-sound See here as the replacement. You could find your things to be fixed here.

If you can't migrate right now, adding a ~300ms delay after stopRecorder() before calling startRecorder() again might help with the teardown race on Android 16 — but that's a workaround, not a real fix.

Could work as work around.

const stop = async () => {
  await audioRecorderPlayer.stopRecorder();
  await new Promise(res => setTimeout(res, 300));
};

Migration is probably the cleaner path here.

User AvatarHirdaya Shrestha
May 21 at 6:10 AM
2