using System;
using System.Collections.Generic;
using System.Linq;
using System.Speech.Recognition;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes; namespace TestWPFAnimation
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
Loaded += MainWindow_Loaded;
} SpeechRecognitionEngine recEngine = new SpeechRecognitionEngine(); void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
Choices preCmd = new Choices();
preCmd.Add(new string[] { "name", "age" });
GrammarBuilder gb = new GrammarBuilder();
gb.Append(preCmd);
Grammar gr = new Grammar(gb);
recEngine.LoadGrammarAsync(gr);
recEngine.SetInputToDefaultAudioDevice();
recEngine.SpeechRecognized += recEngine_SpeechRecognized;
} private void btnEnable_Click(object sender, RoutedEventArgs e)
{ recEngine.RecognizeAsync(RecognizeMode.Multiple);
btnDisable.IsEnabled = true;
} void recEngine_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
{
switch (e.Result.Text)
{
case "name":
txt.Text += "wgscd";
break;
case "age":
txt.Text += "18";
break;
default:
txt.Text = e.Result.Text;
break; } }
private void btnDisable_Click(object sender, RoutedEventArgs e)
{
recEngine.RecognizeAsyncStop();
btnDisable.IsEnabled = false;
} }
}

  

参考:https://www.cnblogs.com/darrenji/p/4373664.html

uwp 语音识别:https://www.cnblogs.com/jinchen/p/uwp-yuyin.html?utm_source=itdadao&utm_medium=referral

C#的语音识别 using System.Speech.Recognition;的更多相关文章

  1. C#中的System.Speech命名空间初探

    本程序是口算两位数乘法,随机生成两个两位数,用语音读出来.然后开启语音识别,接受用户输入,知道答案正确关闭语音识别.用户说答案时,可以说“再说一遍”重复题目. 关键是GrammarBuilder和Ch ...

  2. C# 使用System.Speech 进行语音播报和识别

    C# 使用System.Speech 进行语音播报和识别 using System.Speech.Synthesis; using System.Speech.Recognition; //语音识别 ...

  3. 第三篇:ASR(Automatic Speech Recognition)语音识别

    ASR(Automatic Speech Recognition)语音识别: 百度语音--语音识别--python SDK文档: https://ai.baidu.com/docs#/ASR-Onli ...

  4. 【C#】语音识别 - System.Speech

    一个有趣的东西,今后可能用得上. C#语音识别:在命名空间 System.Speech下SpeechSynthesizer可以将文字转换成语音 贴出代码: public partial class F ...

  5. 论文翻译:2015_DNN-Based Speech Bandwidth Expansion and Its Application to Adding High-Frequency Missing Features for Automatic Speech Recognition of Narrowband Speech

    论文地址:基于DNN的语音带宽扩展及其在窄带语音自动识别中加入高频缺失特征的应用 论文代码:github 博客作者:凌逆战 博客地址:https://www.cnblogs.com/LXP-Never ...

  6. Utterance-Wise Recurrent Dropout And Iterative Speaker Adaptation For Robust Monaural Speech Recognition

    单声道语音识别的逐句循环Dropout迭代说话人自适应     WRBN(wide residual BLSTM network,宽残差双向长短时记忆网络) [2] J. Heymann, L. Dr ...

  7. FPGA 17最佳论文导读 ESE: Efficient Speech Recognition Engine with Compressed LSTM on FPGA

    欢迎转载,转载请注明:本文出自Bin的专栏blog.csdn.net/xbinworld. 技术交流QQ群:433250724,欢迎对算法.机器学习技术感兴趣的同学加入. 后面陆续写一些关于神经网络加 ...

  8. [翻译]Review——How to do Speech Recognition with Deep Learning

    原文地址:https://medium.com/@ageitgey/machine-learning-is-fun-part-6-how-to-do-speech-recognition-with-d ...

  9. 论文阅读笔记“Attention-based Audio-Visual Fusion for Rubust Automatic Speech recognition”

    关于论文的阅读笔记 论文的题目是“Attention-based Audio-Visual Fusion for Rubust Automatic Speech recognition”,翻译成中文为 ...

随机推荐

  1. 小P的架构生活(下)

    小L强烈建议团队使用微服务,并极力推荐了前公司用的一套分布式事务解决方案. 小P经过反复思考查证并做了大量的尝试后,辨证地对微服务架构做了如下分析: 为什么要用微服务,微服务带来了哪些好处? 1.减少 ...

  2. symfony3 使用命令行工具生成Entity实体所踩的坑

    1.把配置文件汇总连接邮箱的配置信息注释掉了,在创建Entity时php bin/console doctrine:generate:entity报错 2. 错误原因是实体文件映射到数据库中的字段时候 ...

  3. VMware三种网络模式详解

    转载自https://www.cnblogs.com/linjiaxin/p/6476480.html 好文章怕原始地址会不能用,转载到自己这里,感谢原作者的无私奉献. 由于Linux目前很热门,越来 ...

  4. 使用Spring Mail发送QQ邮件

    一.邮箱设置 QQ邮箱设置:http://service.mail.qq.com/cgi-bin/help?id=28, 下面这些服务需要开启(需要设置邮箱独立密码): 二.applicationCo ...

  5. 多个jar包合并成一个jar包(ant)

    https://blog.csdn.net/gzl003csdn/article/details/53539133 多个jar包合并成一个jar 使用Apache的Ant是一个基于Java的生成工具. ...

  6. Javascript引擎

    注入了 浏览器对象模型BOM, 文档对象模型DOM

  7. qt5--定时器

    定时器方式一:----定时器事件 需要     #include <QTimerEvent> #include "win.h" #include <QDebug& ...

  8. SQL Server判断表中某字段是否存在【转】

    --比如说要判断表A中的字段C是否存在两个方法: 一, IF EXISTS ( FROM SYSOBJECTS T1 INNER JOIN SYSCOLUMNS T2 ON T1.ID=T2.ID W ...

  9. Python语法汇总

    如果你之前学过任何一门编程语言,因为每种语言的基础语法要做的事情其实基本是相同的,只是表示方式或某些地方稍稍不同,因此在学Python的时候将它与其它你已经掌握的编程语言对比着学,这样学起来更快,效果 ...

  10. vs2017 mvc 自定义路由规则 出现 404.0 错误代码 0x80070002

    自定义: WebApiConfig  里面最后增加 config.Services.Replace(typeof(IHttpControllerSelector), new NamespaceHttp ...