// Use this for initialization
    void Start()
    {
        multiplayer   = gameObject.GetComponent <Multiplayer>();
        emotionColors = new Dictionary <string, Color>()
        {
            { "anger", Color.red },
            { "disgust", Color.green },
            { "fear", Color.magenta },
            { "joy", new Color(1, .5f, 0) },
            { "sadness", Color.blue }
        };
        defaultColors = new List <Color>()
        {
            Color.white
        };
        currentColors = defaultColors;

        clips = Resources.LoadAll <AudioClip>("GordonSounds");

        targetScale = Vector3.one * .01f;

        //StartCoroutine(GetToneAnalysis("I'm happy"));
        //HandleSpeech("menu on");

        dictationRecognizer = new DictationRecognizer(ConfidenceLevel.Rejected);
        dictationRecognizer.AutoSilenceTimeoutSeconds = 2;

        dictationRecognizer.DictationHypothesis += (text) =>
        {
            var outText = "hypothesis: " + text + "...";
            Debug.Log(outText);
            debug.text = outText;
        };

        dictationRecognizer.DictationResult += (text, confidence) =>
        {
            HandleSpeech(text);
            multiplayer.BroadcastSpeech(text);
        };

        dictationRecognizer.DictationComplete += (completionCause) =>
        {
            var outText = "dictation complete. restarting...";
            Debug.Log(outText);
            debug.text = outText;
            dictationRecognizer.Start();
        };

        dictationRecognizer.DictationError += (error, hresult) =>
        {
            var outText = "Dictation error: " + error;
            Debug.LogError(outText);
            debug.text = outText;
        };

        dictationRecognizer.Start();

        manipulationRecognizer = new GestureRecognizer();
        manipulationRecognizer.SetRecognizableGestures(GestureSettings.ManipulationTranslate | GestureSettings.Tap);
        manipulationRecognizer.TappedEvent += ManipulationRecognizer_TappedEvent;
        manipulationRecognizer.ManipulationUpdatedEvent   += ManipulationRecognizer_ManipulationUpdatedEvent;
        manipulationRecognizer.ManipulationCompletedEvent += ManipulationRecognizer_ManipulationCompletedEvent;
        manipulationRecognizer.ManipulationCanceledEvent  += ManipulationRecognizer_ManipulationCompletedEvent;
        manipulationRecognizer.StartCapturingGestures();
    }