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();
     }
 }
Beispiel #2
0
    public bool FlowStart = false;   //流程开始标识

    // Use this for initialization
    void Start()
    {
        if (VoiceManage.MSCLogin() != (int)ErrorCode.MSP_SUCCESS)
        {
            Debug.Log("登陆失败!" + ret); MSC.MSPLogout(); return;
        }
        mc = new M1101Ctrl();
        mc.mResultAction = FlowStartAction;
        u             = Camera.main.GetComponent <UIObject>();
        BeforeAskList = Answer.LoadQuestions(2, 1);
        AfterAskList  = Answer.LoadQuestions(2, 2);
        AnswerList    = Answer.LoadQuestions(1, 1);
        init();
    }
Beispiel #3
0
 public static void MSCLogout()
 {
     MSC.MSPLogout();
 }