private void soundPhrase1_Click(object sender, EventArgs e)
    {
        PictureBox[] PauseSound = { soundPhrase1Pause, soundPhrase2Pause, soundPhrase3Pause, soundPhrase5Pause, soundPhrase6Pause, soundPhrase7Pause,soundPhrase8Pause,soundPhrase9Pause,soundPhrase10Pause,soundPhrase11Pause,soundPhrase12Pause,soundPhrase13Pause,soundPhrase14Pause };
        Label[] labels = { coursLabel, coursLabel1,CoursLabel2,coursLabel3, coursLabel4, coursLabel5, coursLabel6, coursLabel7,coursLabel8,coursLabel9,CoursLabel10,coursLabel11,coursLabel12};
        foreach (PictureBox box in PauseSound) box.Visible = false;
        int i = 0; PictureBox pbox = (PictureBox)sender;
        while (PauseSound[i].Name != pbox.Name + "Pause") { i++; }
        childThread = new Thread(new ThreadStart(() =>
        {


            if ((pbox.Name == pausedName)) { sSynth.Resume(); pausedName = ""; }
            else
            {
                try { sSynth.Pause(); } catch (Exception) { }

                sSynth = new SpeechSynthesizer();
                PromptBuilder pBuilder = new PromptBuilder();
                SpeechRecognitionEngine sRecognize = new SpeechRecognitionEngine(new CultureInfo("fr-FR"));

                pBuilder.ClearContent();
                pBuilder.AppendText(labels[i].Text);
                sSynth.Speak(pBuilder);
                sSynth.Dispose();
                pausedName = "";
                this.Invoke(new MethodInvoker(() => PauseSound[i].Hide()));

            }

        }));
        PauseSound[i].Show();
        PauseSound[i].Click += pause_click;
        childThread.Start();
    }
Exemplo n.º 2
0
        private void Principal_KeyPress(object sender, KeyPressEventArgs e)
        {
            //Muda posição do personagem através do teclado (tecla a para esquerda e tecla d para direita)
            if ((e.KeyChar.ToString().Equals("a") || (Keys)e.KeyChar == Keys.Right) && pbPersonagem.Location.X != 9)
            {
                pbPersonagem.Location = new Point(pbPersonagem.Location.X - 85, pbPersonagem.Location.Y);
            }

            if (e.KeyChar.ToString().Equals("d") && pbPersonagem.Location.X != 179)
            {
                pbPersonagem.Location = new Point(pbPersonagem.Location.X + 85, pbPersonagem.Location.Y);
            }

            //Posições possiveis do personagem:   9; 14 RAIA A
            //  94; 14 RAIA B
            // 179; 15 RAIA C


            if ((Keys)e.KeyChar == Keys.Space && pnRaia.Visible) //Enter da pause no jogo
            {
                //parar de falar
                synthesizer.Pause();

                timer.Stop();
                timer2.Stop();
                MessageBox.Show("PRESS [ENTER] TO RESUME", "PAUSED");
                timer.Start();
                timer2.Start();

                //Retorna a falar
                synthesizer.Resume();
            }
        }
Exemplo n.º 3
0
        private void button_Click(object sender, EventArgs e)
        {
            string            textInput; int type;
            SpeechSynthesizer S = new SpeechSynthesizer();

            // Console.WriteLine("Please Enter Voice type");
            // S.Speak("Please Enter Voice type. Press 1 to select female voice");

            // type = Int32.Parse(Console.ReadLine());
            // if (type == 1)
            S.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult, 1);
            //  else;

            //  Console.WriteLine("Please Enter text");
            S.Speak("Please Enter Text");
            textInput = text.Text;

            S.Speak(textInput);
            S.Pause();                                          //pausing the object
            S.Resume();                                         //resuming the object
            S.Speak("Thankyou for using this software developed by Prerna Sharma.!");
            S.Pause();                                          //pausing the object
            S.Resume();
            S.Speak("Have a nice day ahead");

            S.Dispose();                                        // to free the resources
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            string            text; int type;
            SpeechSynthesizer S = new SpeechSynthesizer();

            Console.WriteLine("Please Enter Voice type");
            S.Speak("Please Enter Voice type. Press 1 to select female voice");

            type = Int32.Parse(Console.ReadLine());
            if (type == 1)
            {
                S.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult, 1);
            }
            else
            {
                ;
            }

            Console.WriteLine("Please Enter text");
            S.Speak("Please Enter Text");
            text = Console.ReadLine();

            S.Speak(text);
            S.Pause();                                      //pausing the object
            S.Resume();                                     //resuming the object
            S.Speak("Thankyou for using this software developed by Prerna Sharma.!");
            S.Pause();                                      //pausing the object
            S.Resume();
            S.Speak("Have a nice day ahead");

            S.Dispose();                                   // to free the resources
            Console.ReadKey();
        }
Exemplo n.º 5
0
 private void BatrasP_Click(object sender, EventArgs e)
 {
     PruebaDePanelesCons consonante = new PruebaDePanelesCons();
     voz.Pause();
     this.Close();
     consonante.Visible = true;
 }
Exemplo n.º 6
0
 private void button2_Click(object sender, EventArgs e)
 {
     _serialPort.Close();
     pictureBox1.Enabled = false;
     lblmessage.Text     = "Application Paused";
     reader.Pause();
 }
        /// <summary>
        /// Handles the SpeechRecognized event of the engine control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Speech.Recognition.SpeechRecognizedEventArgs"/> instance containing the event data.</param>
        void engine_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            //scvText.ScrollToEnd();
            string speech = (e.Result.Text);

            Marvel.SpeakAsyncCancelAll();

            switch (speech)
            {
            //Get weather report
            case "get weather report":
            case "what is the weather today":
            case "what is the weather":
                Marvel.Speak("ok master, before your get with weather report");
                Marvel.Speak("if your city name is in my directory, city name list, then i will search for you ");
                Marvel.Speak("if it is not in my directory then type it on text box and press get weather report button, ");
                Marvel.Speak("ok ready, tell me your city name");
                break;

            case "hide weather report":
                FormBorderStyle = FormBorderStyle.None;
                WindowState     = FormWindowState.Minimized;
                TopMost         = false;
                break;

            case "show weather report":
            case "show weather report again":
                FormBorderStyle = FormBorderStyle.None;
                WindowState     = FormWindowState.Normal;
                TopMost         = true;
                break;

            case "get weather forcast for whole week":
                WeeklyWeather();
                break;

            case "pause":
                Marvel.Pause();
                break;

            case "resume":
                Marvel.Resume();
                break;

            case "stop":
                Marvel.Pause();
                break;

            case "close weather report":
            case "close this":
                UnloadGrammarAndCommands();
                closebtn.PerformClick();
                break;

            default:
                inputtxt.Text = speech;
                yahooweatherbtn.PerformClick();
                break;
            }
        }
Exemplo n.º 8
0
 //Функция для потока
 public void myThread()
 {
     speech.SpeakAsync("Время этапа " + namez + " из Дедлайна " + deadnamez + " вышло! ");
     speech.Resume();
     Thread.Sleep(5000);
     speech.Pause();
 }
Exemplo n.º 9
0
        private void soundPhrase1Pause_Click(object sender, EventArgs e)
        {
            PictureBox pbox = (PictureBox)sender;

            pbox.Visible = false;
            try { sSynth.Pause(); } catch (Exception) { }; pausedName = pbox.Name.Replace("Pause", "");
        }
Exemplo n.º 10
0
 public static void Speak(string msg)                                      // Use for Voice Output
 {
     synth.Pause();
     synth.SpeakAsyncCancelAll();
     synth.Resume();
     synth.SpeakAsync(msg);
 }
Exemplo n.º 11
0
 public void pause()
 {
     if (speechObj.State == SynthesizerState.Speaking)
     {
         speechObj.Pause();
         _ = new SpeechSynthesizer().SpeakAsync("Pausing");
     }
 }
Exemplo n.º 12
0
        private void BJuegos_Click(object sender, EventArgs e)
        {
            JMemoriA memoria = new JMemoriA();

            voz.Pause();
            this.Hide();
            memoria.Visible = true;
        }
Exemplo n.º 13
0
        private void LVocalA_Click(object sender, EventArgs e)
        {
            FVocalA vocala = new FVocalA();

            voz.Pause();
            this.Hide();
            vocala.Visible = true;
        }
Exemplo n.º 14
0
        private void ConsM_Click(object sender, EventArgs e)
        {
            LetraM consonantem = new LetraM();

            voz.Pause();
            this.Hide();
            consonantem.Visible = true;
        }
Exemplo n.º 15
0
        private void button1_Click(object sender, EventArgs e)
        {
            voz.Pause();
            Time = 33;
            Principal principal = new Principal();

            Salto.Visible     = false;
            principal.Visible = true;
        }
Exemplo n.º 16
0
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            JCarro jcarro = new JCarro();

            voz.Pause();
            LVocal.Visible = false;
            LConsM.Visible = false;
            Jcar.Visible   = false;
            Jmen.Visible   = false;
            jcarro.Visible = true;
        }
Exemplo n.º 17
0
 private void StopRead(object sender = null, RoutedEventArgs e = null)
 {
     // Initialize new Reader
     lock (readLock)
     {
         if (reader != null)
         {
             reader.Pause();
             reader.Dispose();
             reader = null;
         }
     }
 }
Exemplo n.º 18
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     if (pr)
     {
         syn.Resume();
         sp.Start();
     }
     else
     {
         syn.Pause();
         sp.Stop();
     }
     pr = !pr;
 }
Exemplo n.º 19
0
 private void cmdPause_Click(object sender, EventArgs e)
 {
     if (_speechState == SynthesizerState.Speaking)
     {
         //cmdPause.Text = "Resume";
         //cmdPause.Enabled = true;
         _speachSyn.Pause();
     }
     else if (_speechState == SynthesizerState.Paused)
     {
         //cmdPause.Text = "Pause";
         //cmdPause.Enabled = true;
         _speachSyn.Resume();
     }
 }
Exemplo n.º 20
0
 public void PausePlay()
 {
     if (IsPaused == false)
     {
         synthesizer.Pause();
         button2.Text = "Play";
         IsPaused     = true;
     }
     else
     {
         synthesizer.Resume();
         button2.Text = "Pause";
         IsPaused     = false;
     }
 }
Exemplo n.º 21
0
        public void Falar(string strTexto)
        {
            SpeechEngine.Rate   = this.Velocidade;
            SpeechEngine.Volume = this.Volume;

            SpeechEngine.StateChanged += SpeechEngine_StateChanged;

            if (!string.IsNullOrWhiteSpace(strTexto))
            {
                switch (SpeechEngine.State)
                {
                case SynthesizerState.Ready:
                    SpeechEngine.SetOutputToDefaultAudioDevice();      //Definindo o dispositivo padrão de reprodução da síntese.
                    SpeechEngine.SpeakAsync(strTexto);
                    break;

                case SynthesizerState.Speaking:
                    SpeechEngine.Pause();
                    break;

                case SynthesizerState.Paused:
                    SpeechEngine.Resume();
                    break;
                }
            }
        }
Exemplo n.º 22
0
 public void PauseTextSpeak()
 {
     if (ts.State == SynthesizerState.Speaking)
     {
         ts.Pause();
     }
 }
Exemplo n.º 23
0
 public void PauseTextSpeak()
 {
     if (m_speechSynthesizer.State == SynthesizerState.Speaking)
     {
         m_speechSynthesizer.Pause();
     }
 }
Exemplo n.º 24
0
 private void button2_Click(object sender, EventArgs e)
 {
     button2.Enabled = false;
     synt.Pause();
     button2.Enabled = true;
     button3.Focus();
 }
Exemplo n.º 25
0
        private void PauseSpeech(bool pause)
        {
            if (pause && speech.State == SynthesizerState.Speaking)
            {
                if (enableTaskbar)
                {
                    taskbarPlayPause.Icon    = Resources.Play;
                    taskbarPlayPause.Tooltip = "Play";

                    taskbar.SetProgressState(TaskbarProgressBarState.Paused);
                }

                buttonPlayPause.Image            = Resources.Play_PNG;
                playPauseToolStripMenuItem.Image = Resources.Play_PNG;
                speech.Pause();
            }
            else if (!pause && speech.State == SynthesizerState.Paused)
            {
                if (enableTaskbar)
                {
                    taskbarPlayPause.Icon    = Resources.Pause;
                    taskbarPlayPause.Tooltip = "Pause";

                    taskbar.SetProgressState(TaskbarProgressBarState.Normal);
                }

                buttonPlayPause.Image            = Resources.Pause_PNG;
                playPauseToolStripMenuItem.Image = Resources.Pause_PNG;
                speech.Resume();
            }
        }
Exemplo n.º 26
0
 /// <summary>
 /// Pauses reader
 /// </summary>
 public void PauseReader()
 {
     if (_reader.State == SynthesizerState.Speaking)
     {
         _reader.Pause();
     }
 }
Exemplo n.º 27
0
 private void buttonPause_Click(object sender, EventArgs e)
 {
     if (voiceBox.State == SynthesizerState.Speaking)
     {
         voiceBox.Pause();
     }
 }
Exemplo n.º 28
0
 private void btnPause_Click(object sender, EventArgs e)
 {
     if (btnPause.Text == "Pause")
     {
         if (reader != null)
         {
             if (reader.State == SynthesizerState.Speaking)
             {
                 reader.Pause();
                 btnPause.Text   = "Resume";
                 btnPlay.Enabled = false;
             }
         }
     }
     else
     {
         if (reader != null)
         {
             if (reader.State == SynthesizerState.Paused)
             {
                 btnPlay.Enabled = true;
                 reader.Resume();
                 btnPause.Text = "Pause";
             }
         }
     }
 }
Exemplo n.º 29
0
 public void voice()
 {
     FixTextTxt.Text = "";
     if (startplay)
     {
         if (playpause)
         {
             playpause = false;
             readerspeak.Resume();
             PlayAction.Content = "Pause";
         }
         else
         {
             playpause = true;
             readerspeak.Pause();
             PlayAction.Content = "Resume";
         }
     }
     else if (!startplay)
     {
         SpeakText(ErrorFix.IsChecked.Value, true);
         // Speak a string asynchronously.
         startplay          = true;
         playpause          = false;
         PlayAction.Content = "Pause";
         Stopbtn.IsEnabled  = true;
     }
 }
Exemplo n.º 30
0
 private void Button2_Click(object sender, EventArgs e)
 {
     if (speech.State == SynthesizerState.Speaking)
     {
         speech.Pause();
     }
 }