Ejemplo n.º 1
0
 // Token: 0x06015981 RID: 88449 RVA: 0x0057FFA8 File Offset: 0x0057E1A8
 public void InitSDK(string appID, int sampleRate)
 {
     try
     {
         if (!XunfeiSDKWrapper.XFWinInit(appID, sampleRate))
         {
             global::Debug.LogError(string.Format("XunfeiSDKWrapper.InitSDK XFWinInit failed, {0}", this.XFWinGetError()));
         }
         else
         {
             XunfeiSDKWrapper.m_isXFInit = true;
         }
     }
     catch (Exception ex)
     {
         global::Debug.LogError(string.Format("XFWinInit exception: {0}", ex.Message));
     }
 }
Ejemplo n.º 2
0
 // Token: 0x06015983 RID: 88451 RVA: 0x00580024 File Offset: 0x0057E224
 public void StopRecord(string audioFilePath)
 {
     if (!XunfeiSDKWrapper.m_isXFInit)
     {
         this.OnSpeechRecognizeFailed();
         return;
     }
     if (XunfeiSDKWrapper.m_isXFInit)
     {
         if (!XunfeiSDKWrapper.XFWinRequestRecognize(audioFilePath))
         {
             this.OnRecognizeFailed(this.XFWinGetError());
         }
     }
     else
     {
         this.OnRecognizeFailed("m_isXFWinInit = false.");
     }
 }
Ejemplo n.º 3
0
    // Token: 0x06015986 RID: 88454 RVA: 0x005800CC File Offset: 0x0057E2CC
    private void Update()
    {
        if (!XunfeiSDKWrapper.m_isXFInit)
        {
            return;
        }
        XunfeiSDKWrapper.XFWinStatus xfwinStatus = this.XFWinGetRecognizeState();
        if (xfwinStatus == XunfeiSDKWrapper.XFWinStatus.COMPLETE)
        {
            return;
        }
        XunfeiSDKWrapper.XFWinTickRecognize(Time.unscaledTime, Time.unscaledDeltaTime);
        xfwinStatus = this.XFWinGetRecognizeState();
        string text = this.XFWinGetError();

        if (xfwinStatus == XunfeiSDKWrapper.XFWinStatus.COMPLETE)
        {
            this.OnAudioRecognized(this.XFWinGetRecognizeResult());
        }
        else if (!string.IsNullOrEmpty(text))
        {
            this.OnRecognizeFailed(text);
        }
    }
Ejemplo n.º 4
0
 // Token: 0x06015980 RID: 88448 RVA: 0x0057FF9C File Offset: 0x0057E19C
 private string XFWinGetError()
 {
     return(Marshal.PtrToStringAnsi(XunfeiSDKWrapper.XFWinGetErrorPtr()));
 }
Ejemplo n.º 5
0
 // Token: 0x0601597F RID: 88447 RVA: 0x0057FF90 File Offset: 0x0057E190
 private string XFWinGetRecognizeResult()
 {
     return(Marshal.PtrToStringAnsi(XunfeiSDKWrapper.XFWinGetRecognizeResultPtr()));
 }
Ejemplo n.º 6
0
 // Token: 0x0601597E RID: 88446 RVA: 0x0057FF88 File Offset: 0x0057E188
 private XunfeiSDKWrapper.XFWinStatus XFWinGetRecognizeState()
 {
     return((XunfeiSDKWrapper.XFWinStatus)XunfeiSDKWrapper.XFWinGetRecognizeIntState());
 }