Beispiel #1
0
    private void SendNetworkSpeechCommand(NetworkSpeechCommand command)
    {
        try
        {
            if (command.Text == "quit")
            {
#if WINDOWS_UWP
                SendResults().Wait();
                Windows.ApplicationModel.Core.CoreApplication.Exit();
#endif
            }

            UnityEngine.WSA.Application.InvokeOnAppThread(() =>
            {
                HoloToolkit.Unity.InputModule.SpeechInputSource src = new HoloToolkit.Unity.InputModule.SpeechInputSource();
                HoloToolkit.Unity.InputModule.InputManager.Instance.RaiseSpeechKeywordPhraseRecognized(
                    src,
                    999,
                    UnityEngine.Windows.Speech.ConfidenceLevel.High,
                    TimeSpan.MinValue,
                    DateTime.Now,
                    new UnityEngine.Windows.Speech.SemanticMeaning[0],
                    command.Text);
                Debug.Log("SendNetworkSpeechCommand worked!");
            }, false);
        }
        catch (Exception ex)
        {
            Debug.LogError(ex.Message);
        }
    }
Beispiel #2
0
        internal void SendSpeechCommand(NetworkSpeechCommand speechCommand)
        {
            var env = new Envelope()
            {
                Content = JsonConvert.SerializeObject(speechCommand),
                Type    = typeof(NetworkSpeechCommand).Name
            };

            _tcpListner.Send(JsonConvert.SerializeObject(env));
        }