delete method

Future<void> delete()

Releases Porcupine and audio resources

Implementation

Future<void> delete() async {
  if (_voiceProcessor?.isRecording ?? false) {
    await _voiceProcessor?.stop();
  }
  _removeVoiceProcessorListener?.call();
  _removeErrorListener?.call();
  _voiceProcessor = null;

  _porcupine?.delete();
  _porcupine = null;
}