Exemple #1
0
 // Update is called once per frame
 void Update()
 {
     if (GameManager.url != "" && img == null)
     {
         StartCoroutine(myCo());
         StartCoroutine(Check());
     }
     if (longStringFromFile != " " && counter < LineList.Length)
     {
         ReadText();
     }
     else
     {
         if (GameManager.piecewiseStep == 0 && GameManager.piecewise == true)
         {
             GameManager.UpdatePieceWiseStep();
         }
         else if (title == "!" && longStringFromFile != " " && counter == LineList.Length && GameManager.piecewise == false)
         {
             title = GameManager.diagramTitle;
             print(title);
             EasyTTSUtil.SpeechAdd(title);
         }
     }
 }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);
//		HomeBackgroundBitmaps = Resources.LoadAll<Sprite>("UI/HomeBackground");
        BackgroundTimer.Interval = 1000 / 15;
        BackgroundTimer.Elapsed += new ElapsedEventHandler(OnBackgroundTimeEvent);
    }
    void printNewInstruction()
    {
        string newInstruct = infoBrg.getNextInstruction();


        if (newInstruct != instruct)
        {
            if (newInstruct != null)
            {
                Debug.Log("Waypoint direction: " + newInstruct);                                // <----DEBUGGING
            }
            if (newInstruct == "Forward")
            {
                EasyTTSUtil.SpeechAdd("Walk " + newInstruct);
                correctDirection = "Forward";
            }
            else if (newInstruct == "Behind")
            {
                EasyTTSUtil.SpeechAdd(" Turn left.");
                correctDirection = "Left";
            }
            else if (newInstruct != null)
            {
                EasyTTSUtil.SpeechAdd("Turn " + newInstruct);
                correctDirection = newInstruct;
            }

            instruct = newInstruct;
        }
    }
Exemple #4
0
 public void speak(string _word)
 {
     if (PlayerPrefs.GetInt("VoiceActivated") == 1)
     {
         EasyTTSUtil.SpeechAdd(_word);
     }
 }
Exemple #5
0
    public void check()
    {
        if (touch == gesture.RIGHT)
        {
            EasyTTSUtil.StopSpeech();
            swipeRight = true;
        }

        if (touch == gesture.LEFT)
        {
            EasyTTSUtil.StopSpeech();
            swipeLeft = true;
        }

        if (touch == gesture.DOUBLE)
        {
            EasyTTSUtil.StopSpeech();
            pressButton();
        }

        if (touch == gesture.UP)
        {
            loop = false;
        }

        if (touch == gesture.DOWN)
        {
            loop = true;
        }
    }
Exemple #6
0
 //private DynamicRooms dr = new DynamicRooms();
 void Start()
 {
     EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);
     //Debug.Log (floorPick());
     introToCurrentMenu();
     //rlc = new RoomLocationsConf ();
 }
Exemple #7
0
 public void startReading(string textToRead)
 {
     if (textToRead.Length > 0)
     {
         EasyTTSUtil.SpeechAdd(textToRead);
     }
 }
Exemple #8
0
    void OnTriggerPass2D(Collider2D other)
    {
        if (other.gameObject.tag == "bathroom")
        {
            tts = "The women's bathrrom is on your left";
            EasyTTSUtil.SpeechAdd(tts);
        }
//		if (other.gameObject.tag == "bathroom") {
//			string bathroom = "";
//			string direction = "";
//			if (bathroomCollision == "") {
//				bathroomCollision = other.gameObject.name;
//			} else {
//				if (other.gameObject.name == "wBathroomRight" && bathroomCollision == "wBathroomLeft") {
//					bathroom = "women's bathroom";
//					direction = "left";
//				}
//				if (other.gameObject.name == "wBathroomRight" && bathroomCollision == "wBathroomRight") {
//					bathroom = "women's bathroom";
//					direction = "right";
//				}
//				if (other.gameObject.name == "mBathroomRight" && bathroomCollision == "mBathroomLeft") {
//					bathroom = "men's bathroom";
//					direction = "left";
//				}
//				if (other.gameObject.name == "mBathroomRight" && bathroomCollision == "mBathroomRight") {
//					bathroom = "men's bathroom";
//					direction = "right";
//				}
//				tts = $"The {bathroom} is on your {direction}";
//				EasyTTSUtil.SpeechAdd(tts);
//				bathroomCollision = "";
//			}
//		}
    }
    void Start()
    {
        // Initialize the player
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);               // text to speech
        //EasyTTSUtil.OpenTTSSetting ();
        playerRigidbody    = GetComponent <Rigidbody>();
        source             = GetComponent <AudioSource> ();
        mode               = 0;
        origin             = new Vector3(-40f, 2f, -53f);
        practicePosition   = new Vector3(50.4f, 2f, -50.7f);
        transform.position = origin;
        start              = "0,0,0";
        //"Not defined yet";
        end = "0,0,0";
        //"Not defined yet";
        isMoving      = false;
        source.clip   = footSteps;
        source.volume = 1f;

        trainingTimes    = 2;
        movedDistance    = 0;
        instruct         = "";
        infoBrg          = new TheInformationBridge();
        correctDirection = "";
        accessDirection  = "";
        logCount         = 0;
        isAllowMove      = true;
        isReachTarget    = false;
    }
Exemple #10
0
        private void Start()
        {
#if !UNITY_EDITOR && UNITY_ANDROID
            EasyTTSUtil.Initialize();
#endif
            StartCoroutine(Init());
        }
Exemple #11
0
 public void OnSoundPlay()
 {
     if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
     {
         EasyTTSUtil.SpeechFlush(m_HiraganaExample);
     }
 }
Exemple #12
0
    void OnGUI()
    {
        GUI.BeginGroup(new Rect(Screen.width / 2 - 250, Screen.height / 2 - 250, 1000, 1000));
        GUI.Box(new Rect(0, 0, 500, 450), "EasyTTS Demo");
        stringToEdit = GUI.TextField(new Rect(30, 30, 440, 160), stringToEdit, 600);

        if (GUI.Button(new Rect(30, 230, 440, 40), "Speak"))
        {
            EasyTTSUtil.SpeechAdd(stringToEdit);
        }
        else if (GUI.Button(new Rect(30, 275, 440, 40), "ENG"))
        {
            // EasyTTSUtil.SpeechFlush (stringToEdit);
            EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);
            EasyTTSUtil.SpeechFlush(eng);
        }
        else if (GUI.Button(new Rect(30, 320, 440, 40), "JP"))
        {
            // EasyTTSUtil.StopSpeech ();
            EasyTTSUtil.Initialize(EasyTTSUtil.Japan);
            EasyTTSUtil.SpeechFlush(jp);
        }
        else if (GUI.Button(new Rect(30, 365, 440, 40), "CH"))
        {
            // stringToEdit = "";
            EasyTTSUtil.Initialize(EasyTTSUtil.China);
            EasyTTSUtil.SpeechFlush(ch);
        }

        GUI.Label(new Rect(30, 420, 440, 100), "Stop and Repeat button only works once build on mobile iOS or Android ");

        GUI.EndGroup();
    }
Exemple #13
0
    void OnGUI()
    {
        GUI.BeginGroup(new Rect(Screen.width / 2 - 250, Screen.height / 2 - 250, 1000, 1000));

        GUI.Box(new Rect(0, 0, 500, 450), "EasyTTS Demo");
        stringToEdit = GUI.TextField(new Rect(30, 30, 440, 200), stringToEdit, 600);
        if (GUI.Button(new Rect(30, 230, 440, 40), "Speak"))
        {
            EasyTTSUtil.SpeechAdd(stringToEdit);
        }
        else if (GUI.Button(new Rect(30, 270, 440, 40), "Repeat"))
        {
            EasyTTSUtil.SpeechFlush(stringToEdit);
        }
        else if (GUI.Button(new Rect(30, 310, 440, 40), "Stop"))
        {
            EasyTTSUtil.StopSpeech();
        }
        else if (GUI.Button(new Rect(30, 350, 440, 40), "Clear"))
        {
            stringToEdit = "";
        }
        GUI.Label(new Rect(30, 400, 440, 100), "Stop and Repeat button only works once build on mobile iOS or Android ");

        GUI.EndGroup();
    }
Exemple #14
0
        public override void Hide()
        {
#if !UNITY_EDITOR && UNITY_ANDROID
            EasyTTSUtil.StopSpeech();
#endif
            m_UI.Hide();
        }
Exemple #15
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag == "door")
        {
            dooraudio.Play();
            EasyTTSUtil.SpeechAdd("this is door.");

            SpeechRecognizerListener listener = GameObject.FindObjectOfType <SpeechRecognizerListener>();
            listener.onFinalResults.AddListener(OnFinalResult);
            listener.onPartialResults.AddListener(OnPartialResult);
            SpeechRecognizer.RequestAccess();

            EasyTTSUtil.SpeechAdd("passed request");

            if (SpeechRecognizer.IsRecording())
            {
                EasyTTSUtil.SpeechAdd("Stoping recording");
                SpeechRecognizer.StopIfRecording();
            }
            else
            {
                SpeechRecognizer.StartRecording(true);
                EasyTTSUtil.SpeechAdd("Start recording");
            }


            EasyTTSUtil.SpeechAdd(resultText);

            EasyTTSUtil.SpeechAdd("and finihsed testing");
        }
    }
Exemple #16
0
    public static void UpdatePieceWiseStep()
    {
        if (piecewise == true)
        {
            GameObject[] elementList = GameObject.FindGameObjectsWithTag("DiagramElement");
            if (piecewiseStep < elementList.Length)
            {
                elementList [piecewiseStep].GetComponent <DiagramElementOBJ> ().enabled = true;
                elementList [piecewiseStep].SetActive(true);
                EasyTTSUtil.StopSpeech();

                if (piecewiseStep == 0)
                {
                    EasyTTSUtil.SpeechAdd(diagramTitle + ", Loaded, " + elementList [piecewiseStep].GetComponent <DiagramElementOBJ> ().elementLabel + ".");
                }
                else if (elementList [piecewiseStep].GetComponent <DiagramElementOBJ> ().elementLabel != "Label")
                {
                    EasyTTSUtil.SpeechAdd(", Loaded, " + elementList [piecewiseStep].GetComponent <DiagramElementOBJ> ().elementLabel + ".");
                }
                piecewiseStep++;
            }
            else
            {
                EasyTTSUtil.StopSpeech();
                EasyTTSUtil.SpeechAdd("All Elements Loaded");
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);
        agent = GetComponent <NavMeshAgent>();
        gmObj = new Dictionary <GameObject,
                                GameObject>()
        {
            // First Floor
            { firstUpStair1,
              upStairA1 },
            { firstUpStair2,
              upStairA2 },
            //Stairs going up
            { firstUpStair3,
              upStairA3 },

            { firstUpElev1,
              upElevA1 },
            { firstUpElev2,
              upElevA2 },
            //Elevators West and East going up

            // Second Floor
            { secondUpStair1,
              upStairB1 },
            { secondUpStair2,
              upStairB2 },
            //Stairs going up
            { secondDnStair1,
              dnStairB1 },
            { secondDnStair2,
              dnStairB2 },
            //Stairs going down
            { secondDnStair3,
              dnStairB3 },

            { secondUpElev1,
              upElevB1 },
            { secondUpElev2,
              upElevB2 },
            //Elevators West and East going up
            { secondDnElev1,
              dnElevB1 },
            { secondDnElev2,
              dnElevB2 },
            //Elevators West and East going down

            // Third Floor
            { thirdDnStair1,
              dnStairC1 },
            { thirdDnStair2,
              dnStairC2 },
            //Stairs going down
            { thirdDnElev1,
              dnElevC1 },
            { thirdDnElev2,
              dnElevC2 },
            //Elevators West and East going down
        };
    }
    void Start()
    {
        toneSource        = this.gameObject.GetComponent <AudioSource> ();
        toneSource.loop   = true;
        toneSource.volume = 0;

        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);

        tagCount = GameObject.FindGameObjectsWithTag("DiagramElement").Length;

        if (tagCount > 0 && GameManager.textList [0] != "")
        {
            int r = int.Parse(GameManager.textList [0]);
            int g = int.Parse(GameManager.textList [1]);
            int b = int.Parse(GameManager.textList [2]);

            elementColor             = new Color32((byte)r, (byte)g, (byte)b, 1);
            elementLabel             = GameManager.textList [3];
            elementDescription       = GameManager.textList [4];
            GameManager.diagramTitle = GameManager.textList [5];
        }
        if (GameManager.piecewise == true)
        {
            elementOrder = GameManager.textList [5];
            this.enabled = false;
        }
    }
Exemple #19
0
    void ClickFour()
    {
        EasyTTSUtil.SpeechAdd("Level four");
        s = "Level four";
        if (isGenerate)
        {
            Debug.Log("Level four");
            Debug.Log(json ["Level four"] ["Start"] [0] [0].AsFloat);
            Debug.Log(json ["Level four"] ["End"].Count);
            rand = (int)Random.Range(0, json ["Level four"] ["End"].Count);

            startPos.x = json ["Level four"] ["Start"] [rand] [0].AsFloat;
            startPos.y = json ["Level four"] ["Start"] [rand] [1].AsFloat;
            startPos.z = json ["Level four"] ["Start"] [rand] [2].AsFloat;
            endPos.x   = json ["Level four"] ["End"] [rand] [0].AsFloat;
            endPos.y   = json ["Level four"] ["End"] [rand] [1].AsFloat;
            endPos.z   = json ["Level four"] ["End"] [rand] [2].AsFloat;
            Debug.Log(startPos);
            Debug.Log(endPos);
            roomLoc.getStartingPoint(startPos);
            roomLoc.getEndingPoint(endPos);
            Application.LoadLevel("CCNYGrove");
        }
        else
        {
            roomLoc.getStartingPoint(new Vector3(44f, 2f, 138.7f));
            roomLoc.getEndingPoint(new Vector3(-62.6f, 2f, 168.5f));
            Application.LoadLevel("CCNYGrove");
        }
    }
    // Use this for initialization

    void Start()
    {
        //EasyTTSUtil.Initialize(EasyTTSUtil.Italy);
        ExhibitID.text      = null;
        ExhibitData.text    = null;
        mTrackableBehaviour = GetComponent <TrackableBehaviour>();
        if (mTrackableBehaviour)
        {
            mTrackableBehaviour.RegisterTrackableEventHandler(this);
        }

        if (PlayerPrefs.GetString("language") == "UnitedKingdom")
        {
            EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);
        }

        if (PlayerPrefs.GetString("language") == "Italy")
        {
            EasyTTSUtil.Initialize(EasyTTSUtil.Italy);
        }

        if (PlayerPrefs.GetString("language") == "France")
        {
            EasyTTSUtil.Initialize(EasyTTSUtil.France);
        }
    }
Exemple #21
0
    // Use this for initialization
    void Start()
    {
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);
        nextDir = new NextDirection();

        readGameResults();
        readNextChoice();
    }
Exemple #22
0
    void Start()
    {
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);

        EasyTTSUtil.SpeechAdd("You're in the mode Selection Menu");
        EasyTTSUtil.SpeechAdd("Please swipe up    to select One route mode, " +
                              "swipe down to select same destination mode.");
    }
Exemple #23
0
 private void Update()
 {
     if (one)
     {
         EasyTTSUtil.SpeechAdd(result);
         one = false;
     }
 }
Exemple #24
0
 // Use this for initialization
 void Start()
 {
     EasyTTSUtil.Initialize(EasyTTSUtil.Japan);
     engineName           = EasyTTSUtil.GetDefaultEngineName();
     dataLoaderListenning = Camera.main.GetComponent <DataLoaderListenning>();
     DownloadTheAudio(dem);
     EasyTTSUtil.SpeechAdd(result);
 }
Exemple #25
0
 public void OnAudioWordBtnPress()
 {
     Debug.Log("VocabularyControl.OnAudioWordBtnPress");
     if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
     {
         EasyTTSUtil.SpeechFlush(m_CurrentWord.VocabularyWord);
     }
 }
Exemple #26
0
 // Update is called once per frame
 void Update()
 {
     if (gonwe_bool)
     {
         EasyTTSUtil.SpeechAdd(speak_e_gao, 1f, 0.5f, 1.0f);
         gonwe_bool = false;
     }
 }
Exemple #27
0
 void Awake()
 {
     enteredString = "";
     _instance     = this;
     EasyTTSUtil.SpeechFlush("Hello");
     audioSource = this.GetComponent <AudioSource>();
     //OpenKeyboard();
 }
 public void startReading(string textToRead)
 {
     // Read the specified text if the string is not empty
     if (textToRead.Length > 0)
     {
         EasyTTSUtil.SpeechAdd(textToRead);
     }
 }
    void rotateAngle(int direction)
    {
        Vector3 rot = transform.rotation.eulerAngles;
        Vector3 newRot;

        if (direction == 1)
        {                                                       // Left
            transform.Rotate(0, -90f, 0);
            newRot = transform.rotation.eulerAngles;

            if (mode == 3)
            {
                if (trainingTimes > 0)
                {
                    EasyTTSUtil.SpeechAdd("Good job. Let's try" + trainingTimes + " more time.");
                    Debug.Log(trainingTimes + " more time(training)");
                    isAllowMove = false;
                    source.Stop();
                    StartCoroutine(MyCoroutine(3));
                    trainingTimes--;
                    transform.position = origin;
                }
                else
                {
                    mode++;
                    resetTutorial();
                }
            }
            //Debug.Log("Degree Turned: " + readDegreeTurnMade (rot, newRot));
            //Debug.Log ("Left Turn...");
        }
        else if (direction == 2)
        {                                                       // Right
            transform.Rotate(0, 90f, 0);
            newRot = transform.rotation.eulerAngles;
            //Debug.Log("Degree Turned: " + readDegreeTurnMade (rot, newRot));
            //Debug.Log ("Right Turn...");

            if (mode == 4)
            {
                if (trainingTimes > 0)
                {
                    EasyTTSUtil.SpeechAdd("Good job. Let's try" + trainingTimes + " more time.");
                    Debug.Log(trainingTimes + " more time(training)");
                    isAllowMove = false;
                    source.Stop();
                    StartCoroutine(MyCoroutine(3));
                    trainingTimes--;
                    transform.position = origin;
                }
                else
                {
                    mode++;
                    resetTutorial();
                }
            }
        }
    }
Exemple #30
0
 void ClickNo()
 {
     EasyTTSUtil.SpeechAdd("no");
     Debug.Log("no");
     //StartCoroutine (MyCoroutine());
     //if(selection > 0)
     Application.LoadLevel("1ModeSelect");
     //selection ++;
 }