Exemple #1
0
 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);
         }
     }
 }
Exemple #2
0
 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);
         }
     }
 }
Exemple #3
0
 public void SetSpkModel(SpkModel spk_model)
 {
     VoskPINVOKE.VoskRecognizer_SetSpkModel(handle, SpkModel.getCPtr(spk_model));
 }
Exemple #4
0
 public void SetMaxAlternatives(int max_alternatives)
 {
     VoskPINVOKE.VoskRecognizer_SetMaxAlternatives(handle, max_alternatives);
 }
Exemple #5
0
 public VoskRecognizer(Model model, float sample_rate, string grammar) : this(VoskPINVOKE.new_VoskRecognizerGrm(Model.getCPtr(model), sample_rate, grammar))
 {
 }
Exemple #6
0
 public VoskRecognizer(Model model, float sample_rate, SpkModel spk_model) : this(VoskPINVOKE.new_VoskRecognizerSpk(Model.getCPtr(model), sample_rate, SpkModel.getCPtr(spk_model)))
 {
 }
Exemple #7
0
 public VoskRecognizer(Model model, float sample_rate) : this(VoskPINVOKE.new_VoskRecognizer(Model.getCPtr(model), sample_rate))
 {
 }
Exemple #8
0
 public static void SetLogLevel(int level)
 {
     VoskPINVOKE.SetLogLevel(level);
 }
Exemple #9
0
 public bool AcceptWaveform(float[] fdata, int len)
 {
     return(VoskPINVOKE.VoskRecognizer_AcceptWaveformFloat(handle, fdata, len));
 }
Exemple #10
0
 public string FinalResult()
 {
     return(global::System.Runtime.InteropServices.Marshal.PtrToStringUTF8(VoskPINVOKE.VoskRecognizer_FinalResult(handle)));
 }
Exemple #11
0
 public int FindWord(string word)
 {
     return(VoskPINVOKE.Model_vosk_model_find_word(handle, word));
 }
Exemple #12
0
 public Model(string model_path) : this(VoskPINVOKE.new_Model(model_path))
 {
 }
Exemple #13
0
 public void SetPartialWords(bool partial_words)
 {
     VoskPINVOKE.VoskRecognizer_SetPartialWords(handle, partial_words ? 1 : 0);
 }
Exemple #14
0
 public void SetWords(bool words)
 {
     VoskPINVOKE.VoskRecognizer_SetWords(handle, words ? 1 : 0);
 }
Exemple #15
0
 public static void GpuInit()
 {
     VoskPINVOKE.GpuInit();
 }
Exemple #16
0
 public bool AcceptWaveform(byte[] data, int len)
 {
     return(VoskPINVOKE.VoskRecognizer_AcceptWaveform(handle, data, len));
 }
Exemple #17
0
 public bool AcceptWaveform(short[] sdata, int len)
 {
     return(VoskPINVOKE.VoskRecognizer_AcceptWaveformShort(handle, sdata, len));
 }
Exemple #18
0
 public void Reset()
 {
     VoskPINVOKE.VoskRecognizer_Reset(handle);
 }
Exemple #19
0
 public string FinalResult()
 {
     return(PtrToStringUTF8(VoskPINVOKE.VoskRecognizer_FinalResult(handle)));
 }
Exemple #20
0
 public static void GpuThreadInit()
 {
     VoskPINVOKE.GpuThreadInit();
 }