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