unloadSttModel method

void unloadSttModel()

Unload the STT model.

Implementation

void unloadSttModel() {
  if (_handle == null || _backendType != 'onnx') return;

  try {
    final destroy =
        _lib.lookupFunction<RacSttOnnxDestroyNative, RacSttOnnxDestroyDart>(
            'rac_stt_onnx_destroy');
    destroy(_handle!);
    _handle = null;
    _currentModel = null;
  } catch (e) {
    throw NativeBackendException('Failed to unload STT model: $e');
  }
}