// Use this for initialization
    void Start()
    {
        TextToSpeechManager textToSpeechManager = this.GetComponent <TextToSpeechManager>();

        textToSpeechManager.Voice = TextToSpeechVoice.Mark;
        textToSpeechManager.SpeakText("Welcome To Explore HoloLens. A Holographic View of a HoloLens device. You can use Gaze, Gesture and Voice Command to explore different components. Walk around and start exploring !");
    }
Exemple #2
0
    private void GestureRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
    {
        GazeManager gm = GazeManager.Instance;

        if (gm.Hit)
        {
            // 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)
            {
                // 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);
            }
        }
    }
    private void GestureRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
    {
        GazeManager gm = GazeManager.Instance;

        if (gm.Hit)
        {
            // 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.SpeakText("This voice should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.");
//                tts.SpeakText("The time is " + DateTime.Now.ToString("t"));
                tts.SpeakText("Your flow of 14 Patients starts from only one entry, which is ALVEOLOPLASTY. Overall, 28.57 % of Patients end at the main exit which is SURG TOOTH EXTRACT NEC (4 Patients). Then, there are CONT MECH VENT < 96 HRS with 2, and finally TOOTH EXTRACTION NEC with 2. ALVEOLOPLASTY: The Patients who began at ALVEOLOPLASTY and finished at SURG TOOTH EXTRACT NEC took only one relevant path: 2 Patients began at ALVEOLOPLASTY before ending at SURG TOOTH EXTRACT NEC. Out of the 4 Patients who began at ALVEOLOPLASTY and resulted at SURG TOOTH EXTRACT NEC, 25 % passed at OTHER GASTROSTOMY, REMOV GASTROSTOMY TUBE, OTHER ORTHODONTIC OPERAT. The Patients who began at ALVEOLOPLASTY and finished at PROSTHET DENTAL IMPLANT took only one relevant path: 1 Patients began at ALVEOLOPLASTY before ending, by a five times repetition, at PROSTHET DENTAL IMPLANT. Out of the 2 Patients who began at ALVEOLOPLASTY and resulted at PROSTHET DENTAL IMPLANT, 50 % passed at SURG TOOTH EXTRACT NEC. The Patients who began at ALVEOLOPLASTY and finished at CONT MECH VENT < 96 HRS took only one relevant path: 1 Patients began at ALVEOLOPLASTY, then to TOOTH EXTRACTION NEC and finally ending at CONT MECH VENT < 96 HRS. Out of the 2 Patients who began at ALVEOLOPLASTY and resulted at CONT MECH VENT < 96 HRS, 100 % passed at TOOTH EXTRACTION NEC, SPINAL TAP, AORTA - SUBCLV - CAROT BYPAS, HEAD / NECK VES RESEC-REPL, REP VESS W SYNTH PATCH, VENOUS CATH NEC, EXTRACORPOREAL CIRCULAT, CARDIOPULM RESUSCITA NOS, ARTERIAL CATHETERIZATION, INSERT ENDOTRACHEAL TUBE. The Patients who began at ALVEOLOPLASTY and finished at TOOTH EXTRACTION NEC took only one path: 2 Patients began at ALVEOLOPLASTY before ending at TOOTH EXTRACTION NEC. ALVEOLOPLASTY is the step that should be focused on to reduce the number of Patients who reach SURG TOOTH EXTRACT NEC");
            }
        }
    }
    public void PlayTextToSpeechMessage(MCSComputerVisionOCRDto computerVisionOCR)
    {
        string message = string.Empty;

        if (string.IsNullOrEmpty(computerVisionOCR.text))
        {
            message = "I couldn't detect text";
        }
        else
        {
            message = string.Format("The text says, {0}", computerVisionOCR.text);
        }

        // Try and get a TTS Manager
        TextToSpeechManager tts = null;

        if (photoCaptureManagerGmObj != null)
        {
            tts = photoCaptureManagerGmObj.GetComponent <TextToSpeechManager>();
        }

        if (tts != null)
        {
            //Play voice message
            tts.SpeakText(message);
        }
    }
Exemple #5
0
    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.
            }
        }
    }
    /// <summary>
    /// Handle On Click Event for Lense
    /// </summary>
    /// <param name="eventData"></param>
    public void OnInputClicked(InputEventData eventData)
    {
        hit = GazeManager.Instance.HitInfo;


        if (hit.transform.gameObject != null)
        {
            isTapped = !isTapped;

            if (isTapped)
            {
                TranslateLenseObjects(-5.0f);


                // Attach Sound Manager while  Air Tap
                var soundManager = GameObject.FindWithTag("SoundManager");
                TextToSpeechManager textToSpeech = soundManager.GetComponent <TextToSpeechManager>();
                textToSpeech.Voice = TextToSpeechVoice.Mark;
                textToSpeech.SpeakText("The HoloLens display is basically a set of transparent lenses placed just in front of the eyes.");
            }
            else
            {
                TranslateLenseObjects(5.0f);
            }
        }
    }
Exemple #7
0
    private void GestureRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
    {
        GazeManager gm = GazeManager.Instance;

        if (gm.Hit)
        {
            // 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.SpeakText("This voice should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.");
                tts.SpeakText("The time is " + DateTime.Now.ToString("t"));
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        ttsMgr = GetComponent <TextToSpeechManager>();
        if (ttsMgr == null)
        {
            Debug.LogError("TextToSpeechManager Required");
        }

        anchorManager = WorldAnchorManager.Instance;
        if (anchorManager == null)
        {
            Debug.LogError("This script expects that you have a WorldAnchorManager component in your scene.");
        }

        spatialMappingManager = SpatialMappingManager.Instance;
        if (spatialMappingManager == null)
        {
            Debug.LogError("This script expects that you have a SpatialMappingManager component in your scene.");
        }

        if (anchorManager != null && spatialMappingManager != null)
        {
            anchorManager.AttachAnchor(this.gameObject, SavedAnchorFriendlyName);
            ttsMgr.SpeakText("Anchor Locked");
        }
        else
        {
            ttsMgr.SpeakText("Cannot Lock Anchor");
        }
    }
Exemple #9
0
    // Use this for initialization
    void Start()
    {
        var soundManager = GameObject.Find("Audio Manager");
        TextToSpeechManager textToSpeech = soundManager.GetComponent <TextToSpeechManager>();

        textToSpeech.Voice = TextToSpeechVoice.Mark;
        textToSpeech.SpeakText("Please walk around and map your room to start the game!");
    }
    private bool IsStartup = true; // See hack comment below

    // Use this for initialization
    void Start()
    {
        ShowcaseModel.SetActive(false);
        InputManager.Instance.PushFallbackInputHandler(gameObject);

        ModelSound = ShowcaseModel.GetComponent <AudioSource>();

        MyTTS = GetComponent <TextToSpeechManager>();
    }
Exemple #11
0
    // Use this for initialization
    void Start()
    {
        var soundManager = gameObject;

        tsm = soundManager.GetComponent <TextToSpeechManager>();

        tsm.SpeakText("Welcome to the Holographic App ! You can use Gaze, Gesture and Voice Command to interact with it!");
        tsm.SpeakText("this is a test!");
    }
Exemple #12
0
    //private TextToSpeech textToSpeech;

    /*private void Awake()
     * {
     *  textToSpeech = GetComponent<TextToSpeech>();
     * }*/

    public void OnInputClicked()
    {
        // Create message
        //var msg = string.Format(
        //"eu", textToSpeech.Voice.ToString());
        // Speak message
        //textToSpeech.StartSpeaking(msg);
        TextToSpeechManager voice = new TextToSpeechManager();

        voice.SpeakText(texto);
    }
Exemple #13
0
    // Use this for initialization
    void Start()
    {
        beep   = GameObject.Find("Beep").GetComponent <AudioSource>();
        boop   = GameObject.Find("Boop").GetComponent <AudioSource>();
        speech = ui.GetComponent <TextToSpeechManager>();

        calibrating          = true;
        AudioListener.volume = 1.0f;

        hud.SetDelegate(AfterHUDText);

        Debug.Log("GOING TO STEP 1");
    }
Exemple #14
0
    // Use this for initialization
    void Start()
    {
        createdTime           = Time.time;
        markedItems           = GameObject.Find("MarkedItems");
        userModeManager       = GameObject.Find("UserModeManager");
        markedItemsScript     = markedItems.GetComponent <MarkedItems>();
        userModeManagerScript = FindObjectOfType <UserModeManager>();

        ttsManager  = FindObjectOfType <TextToSpeechManager>();
        soundPlayer = FindObjectOfType <SoundPlayer>();

        itemAudioSource = gameObject.GetComponent <AudioSource>();
        // itemAudioSource.clip = Resources.Load<AudioClip>("table");
    }
Exemple #15
0
    /// <summary>
    /// GameObject initialization.
    /// </summary>
    private void Start()
    {
        // Update surfaceObserver and storedMeshes to use the same material during scanning.
        SpatialMappingManager.Instance.SetSurfaceMaterial(defaultMaterial);

        // Register for the MakePlanesComplete event.
        SurfaceMeshesToPlanes.Instance.MakePlanesComplete += SurfaceMeshesToPlanes_MakePlanesComplete;

        //  speak
        var soundManager = GameObject.Find("Audio Manager");
        TextToSpeechManager textToSpeech = soundManager.GetComponent <TextToSpeechManager>();

        textToSpeech.Voice = TextToSpeechVoice.Mark;
        textToSpeech.SpeakText("Please walk around and map your room to start the game!");
    }
Exemple #16
0
    public void OnTalk(GameObject go, string text, bool defVoice)
    {
        TextToSpeechManager tts = null;

        if (go != null)
        {
            tts = go.GetComponent <TextToSpeechManager>();
        }

        if (tts != null)
        {
            tts.ChangeVoice(defVoice);
            tts.SpeakText(text);
        }
    }
Exemple #17
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(this);
        }

        List <ISpeechSynthesisVoice> voices = TTS.AllAvailableVoices.ToList();

        TTS.DefaultParameters.Voice           = null; // Default voice
        TTS.DefaultParameters.PitchMultiplier = pitch;
        TTS.DefaultParameters.SpeechRate      = rate;
        //TTS.DefaultParameters.PreUtteranceDelay = preUtteranceDelay;
    }
Exemple #18
0
    // Use this for initialization
    void Start()
    {
        CurrentState = ControlState.WaitingForAnchorStore;

        ttsMgr = GetComponent <TextToSpeechManager>();
        if (ttsMgr == null)
        {
            Debug.LogError("TextToSpeechManager Required");
        }

        anchorManager = WorldAnchorManager.Instance;
        if (anchorManager == null)
        {
            Debug.LogError("This script expects that you have a WorldAnchorManager component in your scene.");
        }

        WorldAnchorStore.GetAsync(AnchorStoreReady);
    }
Exemple #19
0
    public void PlayTextToSpeechMessage(MCSFaceDto face)
    {
        string message     = string.Empty;
        string emotionName = string.Empty;

        if (face.faces.Count > 0)
        {
            EmotionAttributes emotionAttributes = face.faces[0].emotionAttributes;

            Dictionary <string, float> emotions = new Dictionary <string, float>
            {
                { "anger", emotionAttributes.anger },
                { "contempt", emotionAttributes.contempt },
                { "disgust", emotionAttributes.disgust },
                { "fear", emotionAttributes.fear },
                { "happiness", emotionAttributes.happiness },
                { "sadness", emotionAttributes.sadness },
                { "suprise", emotionAttributes.surprise }
            };

            emotionName = emotions.Keys.Max();

            //Message
            message = string.Format("{0} is pretty much {1} years old and looks {2}", face.faces[0].faceAttributes.gender == 0 ? "He" : "She", face.faces[0].faceAttributes.age, emotionName);
        }
        else
        {
            message = "I could't detect anyone.";
        }

        // Try and get a TTS Manager
        TextToSpeechManager tts = null;

        if (photoCaptureManagerGmObj != null)
        {
            tts = photoCaptureManagerGmObj.GetComponent <TextToSpeechManager>();
        }

        if (tts != null)
        {
            //Play voice message
            tts.SpeakText(message);
        }
    }
Exemple #20
0
    void Start()
    {
        tts = GetComponent <TextToSpeechManager>();

        if (alignmentManager)
        {
            alignmentManager.EventAlignmentStarted       += AlignmentManager_EventAlignmentStarted;
            alignmentManager.EventAlignmentFinished      += AlignmentManager_EventAlignmentFinished;
            alignmentManager.EventControllersAvailable   += AlignmentManager_EventControllersAvailable;
            alignmentManager.EventControllersUnavailable += AlignmentManager_EventControllersUnavailable;
        }

        if (networkManager)
        {
            networkManager.AttemptingConnection  += NetworkManager_AttemptingConnection;
            networkManager.ConnectionEstablished += NetworkManager_ConnectionEstablished;
            networkManager.ConnectionLost        += NetworkManager_ConnectionLost;
        }
    }
Exemple #21
0
    private void GestureRecognizer_TappedEvent(InteractionSourceKind source, int tapCount, Ray headRay)
    {
        GazeManager gm = GazeManager.Instance;

        if (gm.Hit)
        {
            // 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)
            {
            }
        }
    }
    public void OnTalk()
    {
        GazeManager gm = GazeManager.Instance;

        if (gm.FocusedObject)
        {
            // Get the target object
            GameObject obj = gm.FocusedObject;

            // 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.SpeakText("This voice should sound like it's coming from the object you clicked. Feel free to walk around and listen from different angles.");
            }
        }
    }
Exemple #23
0
    private void Start()
    {
        sequence = new List <string>
        {
            "EXT_PWR_ON",
            "BAT_ON",
            "APU_MASTER_ON",
            "APU_START_ON",
            "APU_GEN_ON",
            "EXT_PWR_OFF",
            "APU_BLEED_ON",
            "PUMPS_ON",
            "ENG_SWITCH_START",
            "ENG_ON",
            "ENG_LOAD",
            "ENG_SWITCH_NORM",
            "GENERATOR_ON",
            "APU_BLEED_OFF",
            "PACK_ON",
            "APU_OFF",
            "BRAKE_RELEASE",
            "AUTOBRAKE_MAX",
            "SPOILER_ARM",
            "FLAPS",
            "PACK_OFF",
            "THROTTLE_FULL",
            "ACCELERATION",
            "TAKEOFF",
            "GEAR_OFF",
            "VELOCITY",
            "SPOILER_DISARM_AND_FLAPS",
            "VELOCITY2",
            "FLAPS2",
            "END"
        };

        sequenceIndex = 0;
        flag          = true;
        nextTask      = false;

        DirectionalIndicator = GameObject.FindWithTag("DirectionalIndicator");
        MarkerRing           = GameObject.FindWithTag("MarkerRing");
        ContainerBox         = GameObject.FindWithTag("ContainerBox");
        FeedbackHolograms    = GameObject.FindWithTag("FeedbackHolograms");
        if (DirectionalIndicator != null && MarkerRing != null && FeedbackHolograms != null)
        {
            dirInd   = DirectionalIndicator.GetComponent <HeadsUpDirectionIndicator>();
            markRing = MarkerRing.GetComponent <MarkerRing>();
            contBox  = ContainerBox.GetComponent <ContainerBox>();
            feed     = FeedbackHolograms.GetComponent <FeedbackHolograms>();
        }
        if (dirInd == null || markRing == null || contBox == null || feed == null)
        {
            Debug.Log("Cannot find 'HeadsUpDirectionIndicator', 'MarkerRing', 'ContainerBox' and/or 'FeedbackHolograms' scripts.");
        }

        GameObject audioManager = GameObject.FindWithTag("AudioManager");

        if (audioManager != null)
        {
            textToSpeech = audioManager.GetComponent <TextToSpeechManager>();
        }
        if (textToSpeech != null)
        {
            textToSpeech.Voice = TextToSpeechVoice.Default;
            textToSpeech.SpeakText("Welcome aboard the Airbus A320!");
        }
        else
        {
            Debug.Log("Cannot find TextToSpeechManager script.");
        }
        billboardText = GameObject.FindWithTag("AdviceText").GetComponent <Billboard>();

        FileDataReader.Instance.LoadObjectsProperties();

        Invoke("updateComponents", 3);
    }
Exemple #24
0
 // Use this for initialization
 void Start()
 {
     this.textToSpeechManager = this.GetComponent <TextToSpeechManager>();
 }
Exemple #25
0
 void Start()
 {
     textToSpeech       = sound.GetComponent <TextToSpeechManager>();
     textToSpeech.Voice = TextToSpeechVoice.Zira;
 }
Exemple #26
0
 // Use this for initialization
 void Start()
 {
     MyTTS = GetComponent <TextToSpeechManager>();
 }
Exemple #27
0
    void Start()
    {
        Debug.Log("start");
        audioSource = gameObject.GetComponent <AudioSource>();
        tts         = gameObject.GetComponent <TextToSpeechManager>();
        if (File.Exists("config.cfg"))
        {
            var cfg         = Configuration.LoadFromFile("config.cfg");
            var apiSettings = cfg["API"];
            wolframAPIKey = apiSettings["WolframAPIKey"].StringValue;
            Debug.Log("loaded settings from config.cfg");
        }
        LoadSupportedLanguages();
        //SetTargetLang("chinese simplified");
        //StartCoroutine(TranslateText("Waiting for speech"));
        //StartCoroutine(AskWolfram("what is the population of canada"));
        dictationRecognizer = new DictationRecognizer();

        dictationRecognizer.DictationHypothesis += (text) =>
        {
            Debug.LogFormat("Dictation hypothesis: {0}", text);
            WriteOut(text);
        };


        dictationRecognizer.DictationResult += (text, confidence) =>
        {
            Debug.LogFormat("Dictation result: {0}", text);
            var bits = text.Split(' ');
            if (wolframEnabled == false && bits[0] == "translate" && (bits.Length == 3 || bits.Length == 4))
            {
                string name = bits[2];
                if (text.EndsWith("simplified chinese") || text.EndsWith("chinese simplified"))
                {
                    name = "chinese simplified";
                }
                else if (text.EndsWith("traditional chinese") || text.EndsWith("chinese traditional"))
                {
                    name = "chinese traditional";
                }
                else if (text.EndsWith("marry") || text.EndsWith("mouldy") || text.EndsWith("moldy"))
                {
                    name = "maori";
                }
                else if (text.EndsWith("finish"))
                {
                    name = "finnish";
                }

                SetTargetLang(name);
            }
            else if (text == "mute" || text == "shut up" || text == "TTS off" || text == "turn off TTS" || text == "text to speech off" || text == "turn off text to speech")
            {
                ttsEnabled = false;
                englishS   = "TTS off";
                WriteOut();
            }
            else if (text == "speak" || text == "talk now" || text == "TTS on" || text == "turn on TTS" || text == "text to speech on" || text == "turn on text to speech")
            {
                ttsEnabled = true;
                englishS   = "TTS on";
                WriteOut();
            }
            else if (text == "answer my questions" || text == "answer my question")
            {
                wolframEnabled = true;
                englishS       = "Wolfram mode on";
                WriteOut();
            }
            else if (text == "translate for me")
            {
                wolframEnabled = false;
                englishS       = "TTS on";
                WriteOut();
            }
            else if (text == "help" || text == "help me" || text == "what can I say")
            {
                englishS = "Say \"answer my questions\" to switch to wolfram mode. Say \"translate for me\" to switch back to translation mode. Say \"translate to [language_name]\" to change the output language. Say \"turn off/on TTS\" to turn TTS off or on";
                WriteOut();
                tts.SpeakText(englishS);
            }
            else
            {
                englishS = "english: " + text + ". ";
                WriteOut();
                if (wolframEnabled)
                {
                    StartCoroutine(AskWolfram(text));
                }
                else
                {
                    StartCoroutine(TranslateText(text));
                }
            }
        };

        dictationRecognizer.DictationComplete += (completionCause) =>
        {
            Debug.LogErrorFormat("Dictation completed: {0}.", completionCause);
            dictationRecognizer.Start();
        };

        dictationRecognizer.DictationError += (error, hresult) =>
        {
            Debug.LogErrorFormat("Dictation error: {0}; HResult = {1}.", error, hresult);
        };

        dictationRecognizer.Start();
    }