Beispiel #1
0
 /// <summary>
 /// 语音唤醒
 /// </summary>
 public static void VoiceWakeUp()
 {
     try
     {
         int retCode = MSC.MSPLogin(null, null, msp_login.APPID + ",engine_start = ivw,ivw_res_path =fo|res/ivw/wakeupresource.jet,work_dir = .");
         if (retCode != (int)ErrorCode.MSP_SUCCESS)
         {
             Debug.Log("登陆失败!"); return;
         }
         Debug.Log(string.Format("{0} 登陆成功,正在开启引擎..", DateTime.Now.Ticks));
         sid = Utils.Ptr2Str(MSC.QIVWSessionBegin(string.Empty, "sst=wakeup,ivw_threshold=0:-20", ref retCode));
         if (retCode != (int)ErrorCode.MSP_SUCCESS)
         {
             Debug.Log("开启失败!"); return;
         }
         Debug.Log(string.Format("{1} 开启成功[{0}],正在注册..", sid, DateTime.Now.Ticks));
         retCode = MSC.QIVWRegisterNotify(sid, registerCallback, new IntPtr());
         if (retCode != (int)ErrorCode.MSP_SUCCESS)
         {
             Debug.Log("注册失败!"); return;
         }
         Debug.Log(string.Format("{1} 注册成功,语音唤醒[{0}]正在初始化...", sid, DateTime.Now.Ticks));
         VoiceArousal(sid);
         MSC.QIVWSessionEnd(sid, string.Empty);
     }
     finally
     {
         MSC.MSPLogout();
     }
 }