Ejemplo n.º 1
0
        public void SayNumber()
        {
            string          text;
            TextSynthesizer speaker = new TextSynthesizer();

            if (command > 0)
            {
                switch (command)
                {
                case 2:

                    text = Globals.ThisAddIn.GetNextNumber(command);
                    speaker.SpeakWord(text);

                    break;

                case 8:
                    counter--;
                    text = Globals.ThisAddIn.GetNextNumber(command);
                    speaker.SpeakWord(text);

                    break;

                case 5:
                    text = Globals.ThisAddIn.GetCurrentCell();
                    speaker.SpeakWord(text);

                    break;

                default:
                    break;
                }
                command = 0;
            }
        }
Ejemplo n.º 2
0
        private void button2_Click(object sender, RibbonControlEventArgs e)
        {
            talking = !talking;
            string          text;
            TextSynthesizer speaker  = new TextSynthesizer();
            SpeechCommand   listener = new SpeechCommand();

            if (talking)
            {
                button2.Label = "Talking";
            }
            else
            {
                button2.Label = "Silence";
            }
            button2.PerformDynamicLayout();
            if (talking)
            {
                int rec = listener.StartRecognition();
                if (rec > 0)
                {
                    switch (rec)
                    {
                    case 2:
                        counter++;
                        text = Globals.ThisAddIn.GetNextNumber(counter);
                        speaker.SpeakWord(text);

                        break;

                    case 8:
                        counter--;
                        text = Globals.ThisAddIn.GetNextNumber(counter);
                        speaker.SpeakWord(text);

                        break;

                    case 5:
                        text = Globals.ThisAddIn.GetCurrentCell();
                        speaker.SpeakWord(text);

                        break;

                    default:
                        break;
                    }
                    rec = 0;
                }
            }
            else
            {
                listener.CancelRecognition();
            }
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, RibbonControlEventArgs e)
        {
            string          text    = Globals.ThisAddIn.GetReferenceWord();
            TextSynthesizer speaker = new TextSynthesizer();

            speaker.SpeakWord(text);
        }