// Uses Text to Speech Manager to say whatever is in the current open information panel public void Say() { if (textToSpeechManager != null) { if (!textToSpeechManager.IsSpeaking()) { textToSpeechManager.SpeakText(a.getSpeechText()); } else { textToSpeechManager.StopSpeaking(); } } }
private void GestureRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay) { GazeManager gm = GazeManager.Instance; if (gm.IsGazingAtObject) { // Get the target object GameObject obj = gm.HitInfo.collider.gameObject; // Try and get a TTS Manager TextToSpeechManager tts = null; if (obj != null) { tts = obj.GetComponent <TextToSpeechManager>(); } // If we have a text to speech manager on the target object, say something. // This voice will appear to emanate from the object. if (tts != null && !tts.IsSpeaking()) { // Get the name var voiceName = Enum.GetName(typeof(TextToSpeechVoice), tts.Voice); // Create message var msg = string.Format("This is the {0} voice. It should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.", voiceName); // Speak message tts.SpeakText(msg); } else if (tts.IsSpeaking()) { tts.StopSpeaking(); } } }
void IInputHandler.OnInputUp(InputEventData eventData) { if (eventData.PressType == InteractionSourcePressType.Select) { GameObject obj = FocusManager.Instance.TryGetFocusedObject(eventData); // Try and get a TTS Manager TextToSpeechManager tts = (obj == null) ? null : obj.GetComponent <TextToSpeechManager>(); if (tts != null) { // If we have a text to speech manager on the target object, say something. // This voice will appear to emanate from the object. if (!tts.IsSpeaking()) { // Get the name var voiceName = Enum.GetName(typeof(TextToSpeechVoice), tts.Voice); // Create message var msg = string.Format("This is the {0} voice. It should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.", voiceName); // Speak message tts.SpeakText(msg); } else { tts.StopSpeaking(); } eventData.Use(); // Mark the event as used, so it doesn't fall through to other handlers. } } }
public void getPaths() { Debug.Log("getting paths"); textToSpeechManager.StopSpeaking(); string url = "http://pe.qlik.com:8083/listPaths"; WWWForm form = new WWWForm(); form.AddField("field", "val"); WWW www = new WWW(url, form); StartCoroutine(PathRequest(www)); }