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. Ubuntu - 14.04下,GO语言的安装!

    一,下载GO语言的安装文件,我直接下载GO语言的安装包(64位),并不是源码: 下载地址: 64位:https://storage.googleapis.com/golang/go1.6.linux- ...

  2. LeetCode——全排列

    给定一个没有重复数字的序列,返回其所有可能的全排列. 示例: 输入: [1,2,3]输出:[  [1,2,3],  [1,3,2],  [2,1,3],  [2,3,1],  [3,1,2],  [3 ...

  3. SecureCRT 连接 Centos7.0 (NAT模式),且能连接公网。

    1.打开物理主机运行-输入cmd,输入ipconfig,获取物理主机ip地址. ip:192.168.11.138 2.点击网络适配器,选择NAT模式. 3.点击Centos界面左上角-编辑-虚拟网络 ...

  4. linux yum 安装及卸载

    在Centos中yum安装和卸载软件的使用方法安装方法安装一个软件时yum -y install httpd安装多个相类似的软件时yum -y install httpd*安装多个非类似软件时yum ...

  5. ubuntu版本查看命令

    简单的 在命令终端输入 1.cat /etc/issue (简单) 2.cat /etc/lsb-release(具体) 3.uname -a(内核) 具体的 有时候我们安装软件或者搭建服务的时候,需 ...

  6. zencart搜索结果页面静态化 advanced_search_result

    首先,确认网站是否安装了ultimate_seo_urls 伪静态模块. 修改include/classes/seo.url.php 大约126行添加代码 'keyword' => 'sale' ...

  7. 清北学堂dp图论营游记day2

    上午讲数位dp和背包问题. 先讲背包: 完全背包:换了个顺序: 多重背包: 多重背包优化: 这样把每个物品分成这些组,那么把他们转变成不同的物品,就变成了01背包问题: 滑动窗口取最值问题.单调队列优 ...

  8. 高性能mysql 附录D explain执行计划详解

    EXPLAIN: extended关键字:在explain后使用extended关键字,可以显示filtered列和warning信息.在较旧的MySQL版本中,扩展信息是使用EXPLAIN EXTE ...

  9. Java-20180419

    1.leetcode第二题 给定两个链表,逆序转换为数值相加,在逆序输出新链表. Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)Output: 7 - ...

  10. P1879 [USACO06NOV]玉米田Corn Fields[轮廓线DP]

    状压暴力显然可做.但是数据出的再大一点就要稳T了.理论$O(n4^m)$,只不过实际跑不满. 考虑用轮廓线DP,设$f(i,j,S)$为处理到$(i,j)$时候(这格还不确定)的轮廓线为$S$的情况( ...