/// <summary> /// Frees memory that was allocated for Picovoice /// </summary> public void Dispose() { if (_porcupine != null) { _porcupine.Dispose(); _porcupine = null; } if (_rhino != null) { _rhino.Dispose(); _rhino = null; } }
/// <summary> /// Free resources that were allocated to Porcupine and the voice processor /// </summary> public void Delete() { if (_voiceProcessor != null) { if (_voiceProcessor.IsRecording) { _voiceProcessor.StopRecording(); } _voiceProcessor.OnFrameCaptured -= OnFrameCaptured; _voiceProcessor = null; } if (_rhino != null) { _rhino.Dispose(); _rhino = null; } }