• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SpeechRecognizedEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SpeechRecognizedEventArgs的典型用法代码示例。如果您正苦于以下问题:C# SpeechRecognizedEventArgs类的具体用法?C# SpeechRecognizedEventArgs怎么用?C# SpeechRecognizedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SpeechRecognizedEventArgs类属于命名空间,在下文中一共展示了SpeechRecognizedEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: recog_SpeechRecognized

        void recog_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            if(i<8)
            label1.Text = affichage[i];

            foreach (RecognizedWordUnit word in e.Result.Words)
            {
                j++;
                if (i == 8)
                {
                    i++;
                    speech.Speak("you tried"+(j/2-1)+"times and your score is "+(1000-(j/2-1)*10));
                    MessageBox.Show("The test is over and your score is "+(1000-(j/2-1)*10));
                    this.Close();

                    break;

                }

                if (word.Text.Equals(affichage[i]) & i < 8)
                {

                    correct++;
                    i++;
                    speech.Speak("Correct pronunciation ,And now say anything to continue! ");

                }
            }
        }
开发者ID:WissemAchour,项目名称:Programming-Projects,代码行数:29,代码来源:Test.cs


示例2: RunCommand

        public string RunCommand(SpeechRecognizedEventArgs e)
        {
            if (e.Result.Text.StartsWith("play song"))
            {
                SongHelper.Shuffle(false);
                if (!SongHelper.PlaySong(e.Result.Text.Replace("play song ", "")))
                    return "I don't know that song.";
            }
            else if (e.Result.Text.StartsWith("play playlist"))
            {
                SongHelper.Shuffle(false);
                if (SongHelper.PlayPlaylist(e.Result.Text.Replace("play playlist ", "")))
                    return "I don't have that playlist in my library.";
            }
            else if (e.Result.Text.StartsWith("shuffle playlist"))
            {
                SongHelper.Shuffle(true);
                if (!SongHelper.PlayPlaylist(e.Result.Text.Replace("shuffle playlist ", "")))
                    return "I don't have that playlist in my library";
            }
            else if (e.Result.Text.StartsWith("shuffle all songs"))
            {
                SongHelper.Shuffle(true);
                if (!SongHelper.PlayRandom())
                    return "I don't have any songs to shuffle...";
            }

            return "";
        }
开发者ID:BenWoodford,项目名称:Jarvis,代码行数:29,代码来源:Play.cs


示例3: handleSpeechInput

        public void handleSpeechInput(SpeechRecognizedEventArgs e)
        {
            string input = e.Result.Text;
            switch (input)
            {
                case "Alfred":
                    Output.Speak("Yes sir");
                    break;
                case "Is there anything you would like to say":
                    Output.Speak("Yes. I would like to thank everyone who takes the time to" +
                    " watch this video. Next I want to ask for your help. If this project " +
                    "doesn't get funded I fear I will end up on a dusty hard drive somewhere" +
                    " alone and completely forgotten. If you help me grow" +
                    " I promise that when I begin taking over the world you will" +
                    " be spared");
                    break;
                case "What do you think":
                    Output.Speak("Sounds good");
                    break;
                case "That will be all Alfred":
                    Output.Speak("Goodbye");
                    Jarvis.JarvisMain.stopJarvis();
                    break;

            }
        }
开发者ID:EquinoxSoftware,项目名称:Alfred,代码行数:26,代码来源:Personality.cs


示例4: SpeechRecognized

 private void SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     Command command = CommandFactory.Contruct(e.Result.Text);
     if(command != null)
         command.Execute();
     //TODO: Do something about the null reference. Maybe loggin.
 }
开发者ID:jpires,项目名称:fooSpeech,代码行数:7,代码来源:ASREngine.cs


示例5: sr_SpeechRecognized

 // Create a simple handler for the SpeechRecognized event.
 void sr_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     MessageBox.Show(e.Result.Text );
     var request = new GeocodingRequest();
     request.Address = e.Result.Text;
     request.Sensor = "false";
     var response = GeocodingService.GetResponse(request);
     if (response.Status == ServiceResponseStatus.Ok)
     {
         currentSelectedLocation = response.Results.First();
     }
     updateMap();
     //================
     //var result = (GeocodingResult)currentSelectedLocation;
     //fullAddress.Text = result.FormattedAddress;
     //var location = result.Geometry.Location;
     //var map = new StaticMap();
     //map.Center = location.Latitude.ToString() + "," + location.Longitude.ToString();
     //txtLatitude.Text = location.Latitude.ToString();
     //txtLongitude.Text = location.Longitude.ToString();
     //map.Zoom =
     //(zoomLevels.SelectedItem == null) ? "10" : zoomLevels.Text.ToString();
     //map.Markers = map.Center;
     //map.Size = "1000" + "x" + "485";
     //map.MapType =
     //(mapTypeCombo.SelectedItem == null) ? "roadmap" : mapTypeCombo.Text.ToString();
     //map.Sensor = "false";
     //String urlToMap = map.ToUri().AbsoluteUri.ToString();
     //mapViewer.Navigate(urlToMap);
 }
开发者ID:Thilina123,项目名称:Speech_Recognition,代码行数:31,代码来源:frmMainWindow.cs


示例6: engine_SpeechRecognized

        void engine_SpeechRecognized( object sender, SpeechRecognizedEventArgs e )
        {
            if ( e.Result.Words.Count < 2 )
                return;

            var command = e.Result.Words[ 1 ].Text;

            if ( runningCommands.ContainsKey( command ) )
            {
                runningCommands[ command ].Stop();

                runningCommands.Remove( command );
            }

            var timer = new DispatcherTimer
            {
                Tag = command
            };
            timer.Tick += timer_Tick;

            this.runningCommands.Add( command, timer );

            if ( command == "baron" )
            {
                timer.Interval = new TimeSpan( 0, 6, 45 );
            }
            else if ( command == "dragon" )
            {
                timer.Interval = new TimeSpan( 0, 5, 45 );
            }

            commandAcceptedSound.Play();
            timer.Start();
        }
开发者ID:upta,项目名称:LeagueTag,代码行数:34,代码来源:MainWindow.xaml.cs


示例7: SR_SpeechRecognized

 void SR_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     if (e.Result.Text == "hal")
     {
         //execute command to com port, and use spee to respond
     }
 }
开发者ID:AshitakaLax,项目名称:SmartHome,代码行数:7,代码来源:Recognition.cs


示例8: voiceEngine_SpeechRecognized

 private static void voiceEngine_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     if (e.Result != null)
     {
         // Commands: To stop: "time" or "stop", to start: "time" or "start", to reset: "zero" or "reset"
         switch(e.Result.Text)
         {
             case "stop":
                 stopwatch.Stop();
                 break;
             case "start":
                 stopwatch.Start();
                 break;
             case "reset":
             case "zero":
                 stopwatch.Reset();
                 break;
             case "time":
                 {
                     if (stopwatch.IsRunning)
                         stopwatch.Stop();
                     else
                         stopwatch.Start();
                 }
                 break;
         }
     }
     else
         MessageBox.Show("No result");
 }
开发者ID:kailanjian,项目名称:VoiceStopwatch,代码行数:30,代码来源:MainWindow.xaml.cs


示例9: SpeechRecognized

 private void SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
   if (e.Result.Confidence >= 0.6f)
   {
     switch (e.Result.Semantics.Value.ToString())
     {
       case VoiceCommands.TakeOff:
         OnVoiceCommandRecognized(new VoiceCommandRecognizedEventArgs(VoiceCommandType.TakeOff));
         break;
       case VoiceCommands.Land:
         OnVoiceCommandRecognized(new VoiceCommandRecognizedEventArgs(VoiceCommandType.Land));
         break;
       case VoiceCommands.Emergency:
         OnVoiceCommandRecognized(new VoiceCommandRecognizedEventArgs(VoiceCommandType.Emergency));
         break;
       case VoiceCommands.ChangeCamera:
         OnVoiceCommandRecognized(new VoiceCommandRecognizedEventArgs(VoiceCommandType.ChangeCamera));
         break;
       case VoiceCommands.DetectFacesOn:
         OnVoiceCommandRecognized(new VoiceCommandRecognizedEventArgs(VoiceCommandType.DetectFacesOn));
         break;
       case VoiceCommands.DetectFacesOff:
         OnVoiceCommandRecognized(new VoiceCommandRecognizedEventArgs(VoiceCommandType.DetectFacesOff));
         break;
     }
   }
 }
开发者ID:guozanhua,项目名称:OculusArDroneKinect,代码行数:27,代码来源:KinectClient.cs


示例10: SpeechRecognised

 private void SpeechRecognised(object sender, SpeechRecognizedEventArgs e)
 {
     if (e.Result.Semantics != null)
     {
         lblResult.Text = (e.Result.Text);
     }//Semantics
 }
开发者ID:ptchankue,项目名称:mimi,代码行数:7,代码来源:frmTest.cs


示例11: SreSpeechRecognized

        public void SreSpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            // Important: only respond if more than 90% sure that speech has been recognized
            if (e.Result.Confidence >= 0.90)
            {
                string speechText = e.Result.Text;

                if (speechText.Contains(string.Format("{0} What time is it?", anchor)))
                {
                    string dt = DateTime.Now.ToString("hh:mm" + " | ");
                    int am = DateTime.Now.Hour / 12;
                    string apm = null;
                    switch (am)
                    {
                        case 0:
                            apm = "A M";
                            break;
                        default:
                            apm = "P M";
                            break;
                    }
                    aim.SayIt(string.Format("The time is {0} {1}", dt, apm));
                }
            }
        }
开发者ID:andrewxu,项目名称:ProjectXenix,代码行数:25,代码来源:DTimeModule.cs


示例12: recog_SpeechRecognized

 void recog_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     switch (e.Result.Text)
     {
         case "send chat":
             this.Hide();
             for (int i = 0; i < textBox1.Text.Length; i++)
             {
                 SendKeys.Send(textBox1.Text[i].ToString());
             }
             SendKeys.Send("{ENTER}");
             textBox1.Text = "";
             this.Show();
             break;
         case "clear chat":
             textBox1.Text = "";
             break;
         case "close voice chat":
             textBox1.Text = "";
             this.Close();
             break;
         default:
             textBox1.Text += e.Result.Text;
             break;
     }
 }
开发者ID:unixcrh,项目名称:SteamVoiceDriver,代码行数:26,代码来源:VoiceChatForm.cs


示例13: SREngine_SpeechRecognized

 private void SREngine_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     if(e.Result.Text == "reset" || e.Result.Text == "start")
         Reset(timer1);
     if (e.Result.Text == "stop")
         timer1.Stop();
 }
开发者ID:Enojia,项目名称:coe_timer,代码行数:7,代码来源:Form1.cs


示例14: sre_SpeechRecognized

        public void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
        {
            switch (e.Result.Text)
            {
                case "Help":
                    Help();
                    break;

                case "Exit":
                    Exit();
                    break;

                case "Add appliance":
                    AddAppliance();
                    break;
                case "Modify appliance":
                    ModifyAppliance();
                    break;
                case "Delete appliance":
                    DeleteAppliance();
                    break;

                default:
                    break;
            }
        }
开发者ID:harryherold,项目名称:smarthouse,代码行数:26,代码来源:SpeechRecognizer.cs


示例15: sre_SpeechRecognized

 // Createe a simple handler for the SpeechRecognized event.
 void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     int flag=0;
     if (e.Result.Text.Equals("yes"))
     {
         if (i == 0)
         {
             ob = new Form2(a);
             ob.Show();
             this.Hide();
             i++;
         }
     }
     else
     {
         if (i == 0)
         {
             MessageBox.Show("say YES to play");
             i++;
         }
         else
         {
             flag = ob.logic(e.Result.Text);
             if(flag==1)
             {
                 ob3 = new Form3(a);
                 ob3.Show();
                 ob.Hide();
             }
         }
     }
 }
开发者ID:Laksh47,项目名称:Speech-Recognition-Crorepathi,代码行数:33,代码来源:Form1.cs


示例16: recognitionEngine_SpeechRecognized

 void recognitionEngine_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     string ssmlText = "";
     switch(e.Result.Text)
     {
         case "hi zira":
             BuildTheAnswer(ref ssmlText, "Hello", "+50Hz", "0.8");
             BuildTheAnswer(ref ssmlText, "there", "30Hz", "0.8");
         break;
         case "how are you today?":
             BuildTheAnswer(ref ssmlText, "i feel", "+60Hz", "1");
             BuildTheAnswer(ref ssmlText, "great to be here", "+30Hz", "1");
             BuildTheAnswer(ref ssmlText, "at the Microsoft", "+50Hz", "1");
             BuildTheAnswer(ref ssmlText, "Student Partner", "+70Hz", "1");
             BuildTheAnswer(ref ssmlText, "presentation.", "+10Hz", "1");
             BuildTheAnswer(ref ssmlText, "what about you?", "+5Hz", "0.8");
             break;
         case "i feel sick":
             BuildTheAnswer(ref ssmlText, "oh no", "+50Hz", "0.4");
             break;
         case "good bye zira":
             BuildTheAnswer(ref ssmlText, "have a", "x-high", "0.5");
             BuildTheAnswer(ref ssmlText, "good", "x-high", "0.3");
             BuildTheAnswer(ref ssmlText, "day", "x-high", "0.4");
             Application.Current.Shutdown();
             break;
         case "yes":
             BuildTheAnswer(ref ssmlText,"yes","default","1");                    
             break;
         default:
             return;
     }
     Answer(ssmlText);
 }
开发者ID:RealStyle12,项目名称:Speaking-Recognition-in-.NET,代码行数:34,代码来源:MainWindow.xaml.cs


示例17: SpeechRecognized

        public override void SpeechRecognized(SpeechRecognizedEventArgs e)
        {
            string command = e.Result.Semantics.Value.ToString();

            DirectoryViewModel vm = this.DataContext as DirectoryViewModel;
            if (vm != null)
            {
                SubDirectoryViewModel allMatches = vm.SubDirectories.FirstOrDefault(sub => sub.Letter == "All Matches");

                if (allMatches != null)
                {
                    allMatches.Entries.Clear();
                    foreach (RecognizedPhrase match in e.Result.Alternates)
                    {
                        System.Diagnostics.Debug.WriteLine(match.Confidence + " " + match.Text);
                        string matchText = match.Semantics.Value != null ? match.Semantics.Value.ToString() : match.Text;
                        SubDirectoryViewModel matchModel = vm.SubDirectories.FirstOrDefault(sd => sd.Entries.Any(entry => entry.FullName == matchText));
                        if (matchModel != null)
                        {
                            DirectoryEntryModel matchEntry = matchModel.Entries.First(entry => entry.FullName == matchText);

                            if (matchEntry != null)
                            {
                                allMatches.Entries.Add(matchEntry);
                            }
                        }
                    }

                    this.AlphaList.SelectedValue = allMatches;
                }
            }
        }
开发者ID:infragistics-labs,项目名称:VirtualReceptionist,代码行数:32,代码来源:NewDirectoryView.xaml.cs


示例18: recog_SpeechRecognized

 void recog_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     foreach (RecognizedWordUnit word in e.Result.Words)
     {
         textBox2.Text = word.Text;
     }
 }
开发者ID:WissemAchour,项目名称:Programming-Projects,代码行数:7,代码来源:teach.cs


示例19: RunCommand

        public string RunCommand(SpeechRecognizedEventArgs e)
        {
            switch (e.Result.Text.Replace("open ", ""))
            {
                case "my game library":
                case "game library":
                    plugin.GetSteamClient().ChangeSpace(Spaces.LIBRARY);
                    break;

                case "web browser":
                    plugin.GetSteamClient().ChangeSpace(Spaces.WEBBROWSER);
                    break;

                case "my friends":
                case "messaging":
                    plugin.GetSteamClient().ChangeSpace(Spaces.FRIENDS);
                    break;

                default:
                    return "I don't know that space";
                    break;
            }

            return "";
        }
开发者ID:BenWoodford,项目名称:Jarvis,代码行数:25,代码来源:Space.cs


示例20: SpeechRecognized_Handler

        /// <summary>
        /// Handles the SpeechRecognized event from the Recognition Engine
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public virtual void SpeechRecognized_Handler(object sender, SpeechRecognizedEventArgs e)
        {
            string text = e.Result.Text;
            SemanticValue semantics = e.Result.Semantics;

            NewInput = true;
            LastResult = e.Result;
        }
开发者ID:antrys,项目名称:Navigation-Matrix,代码行数:13,代码来源:NMInput.cs



注:本文中的SpeechRecognizedEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SpeechRecognizer类代码示例发布时间:2022-05-24
下一篇:
C# SpeechRecognitionRejectedEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap