Disable built-in speech recognition commands?(禁用内置语音识别命令?)
问题描述
我正在尝试构建能够以自定义方式解释各种文本命令的软件.我使用 System.Speech.Recognition,它的效果出奇地好,但我不知道如何解决这样一个事实,即每当我说删除"、关闭"、更正"等时,我都会以默认值结束Windows (7) 实施.有没有办法通过 System.Speech.Recognition 解决这个问题?如果没有,您最推荐哪个 C# .NET 库?
I'm trying to build software that interprets various textual commands, all in a custom way. I use System.Speech.Recognition and it works surprisingly well, but I can't figure how to get around the fact that whenever I say "Delete", "Close", "Correct", etc, I will end up with the default Windows (7) implementation. Is there any way to get around that with System.Speech.Recognition? If not, which C# .NET library would you recommend the most?
推荐答案
使用 SpeechRecognitionEngine 代替 SpeechRecognizer.
试试这个:
Use SpeechRecognitionEngine instead of SpeechRecognizer.
Try this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Speech.Recognition;
namespace speech
{
class Program
{
static void Main(string[] args)
{
SpeechRecognitionEngine mynizer = new SpeechRecognitionEngine();
GrammarBuilder builder = new GrammarBuilder();
builder.AppendDictation();
Grammar mygram = new Grammar(builder);
mynizer.SetInputToDefaultAudioDevice();
mynizer.LoadGrammar(mygram);
while (true)
{
Console.WriteLine(mynizer.Recognize().Text);
}
}
}
}
这篇关于禁用内置语音识别命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:禁用内置语音识别命令?
基础教程推荐
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- c# Math.Sqrt 实现 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01