private void RecogComplated(IAsyncOperation <SpeechRecognitionResult> asyncInfo, AsyncStatus asyncStatus) { var result = asyncInfo.GetResults(); //result of speech var status = asyncStatus.ToString(); //succes or failed ReadCommands(result.Text, status.ToString()); IAsyncOperation <Windows.Media.SpeechRecognition.SpeechRecognitionResult> speechRecognitionResult = reco.RecognizeAsync(); speechRecognitionResult.Completed += RecogComplated;//restarts recognation }
private void DataSentHandler(IAsyncOperation <uint> asyncInfo, AsyncStatus asyncStatus) { //UnityThread.executeInUpdate(() => { isSending = false; }); if (asyncStatus == AsyncStatus.Error) { MyLog.DebugLog("发送图像帧(TX2)时发生错误" + asyncInfo.ErrorCode); } else if (asyncStatus == AsyncStatus.Completed) { MyLog.DebugLog("Sended to tx2"); } else { Debug.Log(asyncStatus.ToString()); } }
private void ConnectionCompletedHandler(IAsyncOperation <ConnectionSession> asyncInfo, AsyncStatus asyncStatus) { if (asyncInfo.Status == AsyncStatus.Completed) { rootPage.g_ConnectionSession = asyncInfo.GetResults(); UpdateOutputText("Connected to " + rootPage.g_ConnectionSession.ConnectionProfile.ProfileName + "\n" + "Connectivity Level: " + rootPage.g_ConnectionSession.ConnectionProfile.GetNetworkConnectivityLevel()); // Transition button to Disconnect state UpdateButtonText("Disconnect"); connectionResult.Close(); connectionResult = null; } else { UpdateOutputText(asyncStatus.ToString() + ": " + asyncInfo.ErrorCode.Message); UpdateButtonText("Connect"); connectionResult = null; } }
private void ConnectionCompletedHandler(IAsyncOperation<ConnectionSession> asyncInfo, AsyncStatus asyncStatus) { if (asyncInfo.Status == AsyncStatus.Completed) { rootPage.g_ConnectionSession = asyncInfo.GetResults(); UpdateOutputText("Connected to " + rootPage.g_ConnectionSession.ConnectionProfile.ProfileName + "\n" + "Connectivity Level: " + rootPage.g_ConnectionSession.ConnectionProfile.GetNetworkConnectivityLevel()); // Transition button to Disconnect state UpdateButtonText("Disconnect"); connectionResult.Close(); connectionResult = null; } else { UpdateOutputText(asyncStatus.ToString() + ": " + asyncInfo.ErrorCode.Message); UpdateButtonText("Connect"); connectionResult = null; } }