Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Video URL: https://www.youtube.com/watch?v=pD3HdzpX7cg
- Hier die neue public partial Class:
- #region Deklaration der Engine und variablen
- SpeechRecognitionEngine h = new SpeechRecognitionEngine();
- SpeechSynthesizer s = new SpeechSynthesizer();
- CoreAudioDevice defaultPlaybackDevice = new CoreAudioController().DefaultPlaybackDevice;
- //Boolean für den Ruhemodus
- public Boolean hören = true;
- //Boolean für die Google suche
- public Boolean suche = false;
- //Boolean für die Wikipedia suche
- public Boolean wasist = false;
- #endregion
- Hier der neue SpeechRecognizer:
- void recEngine_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
- {
- //bedingungen für ruhemodus
- string modus = e.Result.Text;
- if (modus == "sprich")
- {
- hören = true;
- }
- if (modus == "still")
- {
- hören = false;
- }
- #region google suche core
- if (suche)
- {
- Process.Start("https://www.google.de/search?hl=de&source=hp&ei=Q4-lWrq1BIWWsAep25jwDA&q=" + modus);
- suche = false;
- }
- #endregion
- if (hören == true && suche == false && wasist == false)
- {
- lbl_quest.Text = e.Result.Text;
- switch (e.Result.Text)
- {
- #region google suche
- case "suche nach":
- suche = true;
- break;
- #endregion
- }}}
Add Comment
Please, Sign In to add comment