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