reset method

Future<void> reset()

Resets the internal state of Picovoice. It should be called before processing a new stream of audio or when Picovoice was stopped while processing a stream of audio.

Implementation

Future<void> reset() async {
  if (_porcupine == null || _rhino == null) {
    throw PicovoiceInvalidStateException(
        "Cannot process frame - resources have been released.");
  }

  try {
    _isWakeWordDetected = false;
    await _rhino!.reset();
  } on RhinoException catch (ex) {
    throw mapToPicovoiceException(ex, ex.message);
  }
}