protected virtual void Dispose(bool disposing) { lock (this) { if (handle.Handle != global::System.IntPtr.Zero) { VoskPINVOKE.delete_Model(handle); handle = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } } }
protected virtual void Dispose(bool disposing) { lock (this) { if (handle.Handle != System.IntPtr.Zero) { VoskPINVOKE.delete_VoskRecognizer(handle); handle = new System.Runtime.InteropServices.HandleRef(null, System.IntPtr.Zero); } } }
public void SetSpkModel(SpkModel spk_model) { VoskPINVOKE.VoskRecognizer_SetSpkModel(handle, SpkModel.getCPtr(spk_model)); }
public void SetMaxAlternatives(int max_alternatives) { VoskPINVOKE.VoskRecognizer_SetMaxAlternatives(handle, max_alternatives); }
public VoskRecognizer(Model model, float sample_rate, string grammar) : this(VoskPINVOKE.new_VoskRecognizerGrm(Model.getCPtr(model), sample_rate, grammar)) { }
public VoskRecognizer(Model model, float sample_rate, SpkModel spk_model) : this(VoskPINVOKE.new_VoskRecognizerSpk(Model.getCPtr(model), sample_rate, SpkModel.getCPtr(spk_model))) { }
public VoskRecognizer(Model model, float sample_rate) : this(VoskPINVOKE.new_VoskRecognizer(Model.getCPtr(model), sample_rate)) { }
public static void SetLogLevel(int level) { VoskPINVOKE.SetLogLevel(level); }
public bool AcceptWaveform(float[] fdata, int len) { return(VoskPINVOKE.VoskRecognizer_AcceptWaveformFloat(handle, fdata, len)); }
public string FinalResult() { return(global::System.Runtime.InteropServices.Marshal.PtrToStringUTF8(VoskPINVOKE.VoskRecognizer_FinalResult(handle))); }
public int FindWord(string word) { return(VoskPINVOKE.Model_vosk_model_find_word(handle, word)); }
public Model(string model_path) : this(VoskPINVOKE.new_Model(model_path)) { }
public void SetPartialWords(bool partial_words) { VoskPINVOKE.VoskRecognizer_SetPartialWords(handle, partial_words ? 1 : 0); }
public void SetWords(bool words) { VoskPINVOKE.VoskRecognizer_SetWords(handle, words ? 1 : 0); }
public static void GpuInit() { VoskPINVOKE.GpuInit(); }
public bool AcceptWaveform(byte[] data, int len) { return(VoskPINVOKE.VoskRecognizer_AcceptWaveform(handle, data, len)); }
public bool AcceptWaveform(short[] sdata, int len) { return(VoskPINVOKE.VoskRecognizer_AcceptWaveformShort(handle, sdata, len)); }
public void Reset() { VoskPINVOKE.VoskRecognizer_Reset(handle); }
public string FinalResult() { return(PtrToStringUTF8(VoskPINVOKE.VoskRecognizer_FinalResult(handle))); }
public static void GpuThreadInit() { VoskPINVOKE.GpuThreadInit(); }