KeenASR React Native Plugin (v2.2)
    Preparing search index...
    • Tear down the SDK and release all resources.

      After calling this, you must call initialize again before using any other SDK methods. Any retained ASRResponse objects become invalid.

      The recognizer must not be listening when you call teardown() — it will fail otherwise. If the recognizer might still be listening, stop it first and wait ~200ms for the audio thread to finish:

      const state = await getRecognizerState();
      if (state === RecognizerState.Listening) {
      await stopListening();
      await new Promise((r) => setTimeout(r, 200));
      } else if (state === RecognizerState.FinalProcessing) {
      await new Promise((r) => setTimeout(r, 200));
      }
      await teardown();

      Returns Promise<boolean>

      true if teardown succeeded, false if the SDK was not initialized or the recognizer was still listening.