示例#1
0
 private void button1_Click(object sender, EventArgs e)
 {
     sy.Rate = (int)-2;
     pb.ClearContent();
     pb.AppendText(label1.Text);
     sy.Speak(pb);
 }
        private void myspeech_myrecognizedvoice(object sender, SpeechRecognizedEventArgs e)
        {
            switch (e.Result.Text)
            {
            case "what your name":
                textBox1.Text = "My name is Dell Computer";
                mypromp.ClearContent();
                mypromp.AppendText(textBox1.Text);
                myvoice.Speak(mypromp);

                break;



            case "what you like":
                textBox1.Text = "I like the Rishabh";
                mypromp.ClearContent();
                mypromp.AppendText(textBox1.Text);
                myvoice.Speak(mypromp);

                break;



            case "are you know who i am":
                textBox1.Text = "I Think Rishabh";
                mypromp.ClearContent();
                mypromp.AppendText(textBox1.Text);
                myvoice.Speak(mypromp);

                break;
            }
        }
示例#3
0
 private void Talk_Btn_Click(object sender, EventArgs e)
 {
     pBuilder.ClearContent();
     pBuilder.AppendText(speek_box.Text);
     Debug("(Ai):(Said):" + speek_box.Text);
     sSynth.Speak(pBuilder);
 }
示例#4
0
        void SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            string text = e.Result.Text;

            switch (e.Result.Text)
            {
            case "open cassandra":
                System.Diagnostics.Process.Start("C:/Users/Phillip/Desktop/Cassandra");
                prompt.ClearContent();
                prompt.AppendText("Cassandra opened");
                synt.Speak(prompt);
                break;

            case "open chrome":
            {
                System.Diagnostics.Process.Start("C:/Program Files (x86)/Google/Chrome/Application/chrome.exe");
                prompt.ClearContent();
                prompt.AppendText("Chrome opened");
                synt.Speak(prompt);
                break;
            }

            case "exit":
                prompt.ClearContent();
                prompt.AppendText("Exiting");
                synt.Speak(prompt);
                Application.Exit();
                break;
            }
        }
示例#5
0
        public Principal()
        {
            InitializeComponent();
            this.CenterToScreen();


            Choices commands = new Choices();

            commands.Add(new string[] { "start", "hello", "hi" });
            gBuilder = new GrammarBuilder();
            gBuilder.Append(commands);

            Grammar grammar = new Grammar(gBuilder);

            recEngine.LoadGrammarAsync(grammar);


            pBuild.AppendText("Hello");
            sSynth.Speak(pBuild);
            pBuild.ClearContent();

            recEngine.SetInputToDefaultAudioDevice();

            recEngine.SpeechRecognized += recEngine_SpeechRecognized;
            agent = new Thread(agenteVoz);
            agent.Start();
        }
示例#6
0
        private void AppendBreak(int ms)
        {
            int ns = ms * 10000;

            pb.ClearContent();
            pb.AppendBreak(new TimeSpan(ns));
            synth.Speak(pb);
            pb.ClearContent();
        }
        /// <summary>
        /// Runs every time our 2D coordinates are ready.
        /// </summary>
        /// <param name="sender">The sender object</param>
        /// <param name="a">Skeleton 2Ddata Coord Event Args</param>
        private void NuiSkeleton2DdataCoordReady(object sender, Skeleton2DdataCoordEventArgs a)
        {
            currentBufferFrame.Text = _video.Count.ToString();

            // We need a sensible number of frames before we start attempting to match gestures against remembered sequences
            if (_video.Count > MinimumFrames && _capturing == false)
            {
                ////Debug.WriteLine("Reading and video.Count=" + video.Count);
                string s = _dtw.Recognize(_video);
                results.Text = "Recognised as: " + s;
                if (!s.Contains("__UNKNOWN"))
                {
                    // There was no match so reset the buffer
                    _video        = new ArrayList();
                    textBox2.Text = textBox2.Text + " " + s.Substring(1);
                    //if ()
                    //{
                    pBuilder.ClearContent();
                    pBuilder.AppendText(s.Substring(1));
                    sSynth.Speak(pBuilder);
                    //}
                }
            }

            // Ensures that we remember only the last x frames
            if (_video.Count > BufferSize)
            {
                // If we are currently capturing and we reach the maximum buffer size then automatically store
                if (_capturing)
                {
                    DtwStoreClick(null, null);
                }
                else
                {
                    // Remove the first frame in the buffer
                    _video.RemoveAt(0);
                }
            }

            // Decide which skeleton frames to capture. Only do so if the frames actually returned a number.
            // For some reason my Kinect/PC setup didn't always return a double in range (i.e. infinity) even when standing completely within the frame.
            // TODO Weird. Need to investigate this
            if (!double.IsNaN(a.GetPoint(0).X))
            {
                // Optionally register only 1 frame out of every n
                _flipFlop = (_flipFlop + 1) % Ignore;
                if (_flipFlop == 0)
                {
                    _video.Add(a.GetCoords());
                }
            }

            // Update the debug window with Sequences information
            //dtwTextOutput.Text = _dtw.RetrieveText();
        }
示例#8
0
 //IT ALLOWS THE SOFTWARE TO REPLY TO THE USER
 void compSpeak(string text)
 {
     sRec.RecognizeAsyncCancel();
     sRec.RecognizeAsyncStop();
     pBuilder.ClearContent();
     pBuilder.AppendText(text.ToString());
     sSynt.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult);
     sSynt.SpeakAsync(pBuilder);
     sRec.RecognizeAsyncCancel();
     sRec.RecognizeAsyncStop();
     sRec.RecognizeAsync(RecognizeMode.Multiple);
 }
 public void speakText(string textSpeak)
 {
     sRecognize.RecognizeAsyncCancel();
     sRecognize.RecognizeAsyncStop();
     pBuilder.ClearContent();
     pBuilder.AppendText(textSpeak.ToString());
     sSynth.SelectVoice(name);
     sSynth.SpeakAsync(pBuilder);
     sRecognize.RecognizeAsyncCancel();
     sRecognize.RecognizeAsyncStop();
     sRecognize.RecognizeAsync(RecognizeMode.Multiple);
 }
示例#10
0
        void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            MessageBox.Show("done");
            textBox1.Text += e.Result.Text;
            if (e.Result.Text == "open google")
            {
                Process.Start("www.google.com");
                sys.Dispose();
            }
            else if (e.Result.Text == "open facebook")
            {
                Process.Start("www.facebook.com");
            }

            else if (e.Result.Text == "open twitter")
            {
                Process.Start("www.twitter.com");
            }
            else if (e.Result.Text == "open youtube")
            {
                Process.Start("www.youtube.com");
            }
            if ((e.Result.Text == "surah al fatiha") || (e.Result.Text == "recite surah al fatiha") || (e.Result.Text == "parho surah al fatiha"))
            {
                wmplayer.Visible         = true;
                wmplayer.URL             = @"C:\Users\Yousha Arif\Desktop\001.mp3";
                wmplayer.settings.volume = 100;
            }
            else if ((e.Result.Text == "call yusha") || (e.Result.Text == "call"))
            {
                prmpb.ClearContent();
                prmpb.AppendText("ok");
                sys.Speak(prmpb);
                Process.Start("Skype", " /callto:youshaarif");
            }
            //else if (e.Result.Text == "open")
            //{
            //    textBox1.Text = e.Result.Text[0].ToString();
            //    // Process.Start("www.google.com.pk/#q="+e.Result.Text[1]);
            //}

            //else
            //{
            //    prmpb.ClearContent();
            //    prmpb.AppendText("sorry try again");
            //    sys.Speak(prmpb);
            //}
            ////textBox1.Text = e.Result.Text;


            //throw new NotImplementedException();
        }
示例#11
0
        private void myspeech_myrecognizedvoice(object sender, SpeechRecognizedEventArgs e)
        {
            switch (e.Result.Text)
            {
            case "rishabh stop":
                textBox1.Text = "dinker are you ready";
                mypromp.ClearContent();
                mypromp.AppendText(textBox1.Text);
                myvoice.Speak(mypromp);
                serialPort1.Write("0");
                break;



            case "rishabh left":
                textBox1.Text = "Rishabh Move left";
                mypromp.ClearContent();
                mypromp.AppendText(textBox1.Text);
                myvoice.Speak(mypromp);
                serialPort1.Write("1");
                break;



            case "rishabh right":
                textBox1.Text = "Rishabh Move right";
                mypromp.ClearContent();
                mypromp.AppendText(textBox1.Text);
                myvoice.Speak(mypromp);
                serialPort1.Write("2");
                break;


            case "rishabh backward":
                textBox1.Text = "Rishabh Move backward";
                mypromp.ClearContent();
                mypromp.AppendText(textBox1.Text);
                myvoice.Speak(mypromp);
                serialPort1.Write("3");
                break;



            case "rishabh forward":
                textBox1.Text = "Rishabh Move forward";
                mypromp.ClearContent();
                mypromp.AppendText(textBox1.Text);
                myvoice.Speak(mypromp);
                serialPort1.Write("4");
                break;
            }
        }
示例#12
0
 // returns board square for the given name
 private Squar GetBoardSquar(string strCellName)
 {
     style.AppendTextWithHint(strCellName, SayAs.SpellOut);  // speak out selected square coordinates
     sSynth.SpeakAsync(style);
     style.ClearContent();
     foreach (Squar ChessSquar in Squars)
     {
         if (ChessSquar.Name == strCellName)
         {
             return(ChessSquar);
         }
     }
     return(null);
 }
示例#13
0
        // Called when click on any chess square object
        private void Squar_Click(object sender, System.EventArgs e)
        {
            if (m_ParentGame.IsRunning && !m_ParentGame.ChessGame.ActivePlay.IsComputer())
            {
                Squar ChessSquar = (Squar)sender;
                //              m_ParentGame.Sounds.PlayClick();
                style.AppendTextWithHint(ChessSquar.Name, SayAs.SpellOut);
                sSynth.Speak(style);  // audio output coordinates of clicked empty square
                style.ClearContent();

                m_ParentGame.SelectedSquar = ChessSquar.Name;
                m_ParentGame.RedrawBoard();
            }
        }
示例#14
0
        private void button3_Click(object sender, EventArgs e)
        {
            pBuilder.ClearContent();
            pBuilder.AppendText(richTextBox2.Text);

            sSynth.Speak(pBuilder);
        }
        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();
    }
        //Allows this object class to easily say anything
        //Without providing specifics.
        public void say_default(string input)
        {
            string voice_string = input;

            //reader.SelectVoice("IVONA 2 Salli");
            style_.Rate     = PromptRate.Medium;
            style_.Emphasis = PromptEmphasis.NotSet;
            builder.ClearContent();
            builder.StartSentence();
            builder.StartStyle(style_);
            builder.AppendText(voice_string);
            builder.EndStyle();
            builder.EndSentence();
            //lastly let the ball roll and see if we can hear some chatter.
            reader.Speak(builder);
        }
示例#17
0
        private void button1_Click(object sender, EventArgs e)
        {
            Speak_Button.Text = "Activated";
            aiSpeech.SelectVoiceByHints(VoiceGender.Female);
            aiSpeech.Speak("hi, i am alert ai. if you need me, just say \"hey alert\".");
            Choices commandList = new Choices();

            commandList.Add(File.ReadAllLines(@"C:\ALERT AI\commands.txt"));

            Grammar grammarObject = new Grammar(new GrammarBuilder(commandList));

            try
            {
                aiRecognise.RequestRecognizerUpdate();
                aiRecognise.LoadGrammar(grammarObject);
                aiRecognise.SpeechRecognized += aiRecognise_SpeechRecognized;
                aiRecognise.SetInputToDefaultAudioDevice();
                aiRecognise.RecognizeAsync(RecognizeMode.Multiple);
            }
            catch
            {
                return;
            }
            aiPrompt.ClearContent();
            aiSpeech.Speak(aiPrompt);
        }
示例#18
0
        public void sayAppointment(string[] whatToSay)
        {
            //whatToSay[0] = index
            //whatToSay[1] = Subject
            //whatToSay[2] = Date
            string[] date    = whatToSay[2].Split('/');
            string   newDate = date[1] + "/" + date[0];

            //whatToSay[3] = Time
            string[] time    = whatToSay[3].Split(':');
            string   newTime = time[0] + ":" + time[1];
            //whatToSay[4] = Location

            PromptBuilder appointmentBuilder = new PromptBuilder();

            appointmentBuilder.StartVoice("IVONA 2 Brian");
            appointmentBuilder.AppendText("Appointment " + whatToSay[0]);
            appointmentBuilder.AppendText(", subject is: " + whatToSay[1]);
            appointmentBuilder.AppendSsmlMarkup(", on <say-as interpret-as=\"date_md\">" + newDate + "</say-as>");
            appointmentBuilder.AppendSsmlMarkup(" <say-as interpret-as=\"time\">" + newTime + "</say-as>");
            appointmentBuilder.AppendText(", at " + whatToSay[4]);
            appointmentBuilder.EndVoice();

            JARVIS.Speak(appointmentBuilder);
            appointmentBuilder.ClearContent();
        }
示例#19
0
        private void sound_click(object sender, EventArgs e)
        {
            SpeechSynthesizer       sSynth     = new SpeechSynthesizer();
            PromptBuilder           pBuilder   = new PromptBuilder();
            SpeechRecognitionEngine sRecognize = new SpeechRecognitionEngine(new CultureInfo("fr-FR"));
            PictureBox pbox = (PictureBox)sender;

            string[] ss = pbox.Tag.ToString().Split('-');
            pBuilder.ClearContent();
            string min = ss[1].Trim(), heure = ss[0].Trim(), textToAppend = "";



            if (min == "00")
            {
                textToAppend = heure;
            }
            else
            {
                if (min == "15")
                {
                    textToAppend = heure + " et quart";
                }
                else
                {
                    if (min == "30")
                    {
                        textToAppend = heure + " et demi";
                    }
                    else
                    {
                        if (min == "45")
                        {
                            textToAppend = (int.Parse(heure) + 1).ToString() + " moins le quart";
                        }
                        else
                        {
                            if (min == "50")
                            {
                                textToAppend = (int.Parse(heure) + 1).ToString() + " moins 10";
                            }
                            else
                            {
                                if (min == "5")
                                {
                                    textToAppend = (int.Parse(heure) + 1).ToString() + " moins 5";
                                }
                                else
                                {
                                    textToAppend = heure + " heures " + min + " minutes";
                                }
                            }
                        }
                    }
                }
            }
            pBuilder.AppendText(textToAppend);
            sSynth.Speak(pBuilder);
        }
示例#20
0
 void Button1Click(object sender, EventArgs e)
 {
     build.ClearContent();
     build.AppendText(textBox1.Text);
     synt.Speak(build);
     synt.Volume = 100;
     synt.Rate   = 2;
 }
示例#21
0
 private void Welcome_Load(object sender, EventArgs e)
 {
     this.Show();
     pb.ClearContent();
     spsy.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Child);
     pb.AppendText("Hello Admin , Welcome To the Payroll Management System ! Please Double Click to Log into the System.");
     spsy.Speak(pb);
 }
示例#22
0
        private void stopTale()
        {
            if (mediaPlayerTale != null)
            {
                mediaPlayerTale.Stop();
                timerMusic.Stop();
                mediaPlayerTale.Close();
            }

            timerPage.Stop();

            if (speak != null)
            {
                speak.SpeakerStop();
                builder.ClearContent();
            }
        }
        /// <inheritdoc cref="ITextVoicer.SayMessage(string)"/>
        public void SayMessage(string message)
        {
            messageBuilder.StartStyle(voicerSpeed);
            messageBuilder.AppendText(message);
            messageBuilder.EndStyle();
            textVoicer.SpeakAsync(messageBuilder);

            messageBuilder.ClearContent(); //Removes sentences that have already been appended.
        }
 public void SpeakNow(string text)
 {
     var pBuilder = new PromptBuilder();
     pBuilder.ClearContent();
     pBuilder.AppendText(text + " is to be said as ");
     // pBuilder.AppendText(tvm.Translations.Last().Target);
     var speaker = new SpeechSynthesizer();
     speaker.Speak(pBuilder);
 }
示例#25
0
 public void say(string message)
 {
     if (this.Accessibility)
     {
         pb.ClearContent();
         pb.AppendText(message);
         speechSynth.Speak(pb);
     }
 }
示例#26
0
        public void speakMsg(string Message)
        {
            PromptBuilder speakRate = new PromptBuilder();

            speakRate.StartVoice(voice);
            speakRate.AppendText(Message, PromptRate.Slow);
            speakRate.EndVoice();
            speak.Speak(speakRate);
            speakRate.ClearContent();
        }
示例#27
0
        private void button2_Click_1(object sender, EventArgs e)
        {
            string naoDeixarLerHtml = Regex.Replace(webBrowser2.DocumentText, @"<[^>]*>", String.Empty);

            pBuilder.ClearContent();

            pBuilder.AppendText(naoDeixarLerHtml);

            sSynth.Speak(pBuilder);
        }
示例#28
0
        void Sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            Pb.ClearContent();
            SpVoice obj = new SpVoice();

            switch (e.Result.Text)
            {
            case "dashboard":
                Pb.ClearContent();
                Dashboard();
                Pb.AppendText("dashboard panel opened");
                Ss.Speak(Pb);
                break;

            case "schedule":
                Pb.ClearContent();
                Schedules();
                Pb.AppendText("schedule panel opened");
                Ss.Speak(Pb);
                break;

            case "inventory":
                Pb.ClearContent();
                Inventory();
                Pb.AppendText("inventory panel opened");
                Ss.Speak(Pb);
                break;

            case "student":
                Pb.ClearContent();
                Students();
                Pb.AppendText("student panel opened");
                Ss.Speak(Pb);
                break;

            case "Log out":
                Pb.ClearContent();
                Pb.AppendText("logging out");
                Ss.Speak(Pb);
                Login login = new Login();
                login.Show();
                this.Hide();
                break;

            //Computer Module Testing
            case "Activate Computer Laboratory":
                ComputerModule computermodule = new ComputerModule();
                Pb.ClearContent();
                Pb.AppendText("Computer Laboratory Activated");
                Ss.Speak(Pb);
                Sre.RecognizeAsyncStop();
                computermodule.Show();
                this.Hide();
                break;
                //End of Computer Module
            }
        }
示例#29
0
 public void Asynth()
 {
     try
     {
         aSynth.SpeakAsyncCancelAll();
         pBuilder.ClearContent();
         pBuilder.AppendText(sentence);
         aSynth.Speak(pBuilder);
     }
     catch { return; }
 }
示例#30
0
        private void BtnPreviewTTS_Click(object sender, EventArgs e)
        {
            string messageDemo = TTSDemoBuilder().Item1;
            var    builder     = new PromptBuilder();

            builder.StartVoice(new CultureInfo(csgo_tts_main.region));
            builder.AppendText(messageDemo);
            builder.EndVoice();
            csgo_tts_main.synthesizer.SpeakAsync(builder);
            builder.ClearContent();
        }
示例#31
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (eText.Text.Equals("") || pText.Text.Equals(""))
            {
                linkLabel2.Text = "Required to Fill All The Field !!!";
                linkLabel1.Hide();
                pBuild.ClearContent();
                pBuild.AppendText("Required to Fill All The Field");
                sSynth.Speak(pBuild);
            }
            else
            {
                pBuild.ClearContent();
                pBuild.AppendText("Access Granted");
                sSynth.Speak(pBuild);

                EmpProfile em = new EmpProfile(this);
                em.Show();
                this.Hide();
            }
        }
示例#32
0
        protected override void HandleNotification(Notification notification, string displayName)
        {
            /*
            string xml = @"<p>
                            <s>You have 4 new messages.</s>
                            <s>The first is from Stephanie Williams and arrived at <break/> 3:45pm.
                            </s>
                            <s>
                              The subject is <prosody rate=""-20%"">ski trip</prosody>
                            </s>
                          </p>";
             * */

            PromptBuilder pb = new PromptBuilder();

            // handle title
            if (notification.CustomTextAttributes != null && notification.CustomTextAttributes.ContainsKey("Notification-Title-SSML"))
                pb.AppendSsmlMarkup(notification.CustomTextAttributes["Notification-Title-SSML"]);
            else
                pb.AppendText(notification.Title, PromptEmphasis.Strong);

            pb.AppendBreak();

            // handle text
            if (notification.CustomTextAttributes != null && notification.CustomTextAttributes.ContainsKey("Notification-Text-SSML"))
                pb.AppendSsmlMarkup(notification.CustomTextAttributes["Notification-Text-SSML"]);
            else
                pb.AppendText(notification.Description);

            try
            {
                ss.Speak(pb);
            }
            catch (Exception ex)
            {
                Growl.CoreLibrary.DebugInfo.WriteLine("Unable to speak input: " + ex.Message);

                // fall back to plain text (if the plain text is what failed the first time, it wont work this time either but wont hurt anything)
                pb.ClearContent();
                pb.AppendText(notification.Title, PromptEmphasis.Strong);
                pb.AppendBreak();
                pb.AppendText(notification.Description);
                ss.Speak(pb);
            }
        }