客户端系统中C#语音检测问题的语音识别项目。我们需要在用户系统安装任何软件包吗? [英] Speech recognition project in C# voice detection problem at client system. Do we need to install any packages at user system?

查看:69
本文介绍了客户端系统中C#语音检测问题的语音识别项目。我们需要在用户系统安装任何软件包吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

语音识别项目在c#客户端系统的语音检测问题。我们是否需要在用户系统上安装任何软件包?



我在WPF中创建了带有c#background语音识别的项目。代码是:

--------------------------------------- -------------------------------------------------- ------------

在XAML中语音功能称为Loaded =BtnStart_Click





后端.cs代码:



使用System.Speech.Synthesis;

使用System.Speech.Recognition;

使用System.Diagnostics;



private void BtnStart_Click(对象发送者,RoutedEventArgs e )

{

btnStart.IsEnabled = false;

btnStop.IsEnabled = true;

clist.Add( new string [] {search,1st standard,1st Maths,Chapter 1,VML,namaste,你好吗,我怎么能帮助你,打开vidwath english ,谢谢,关闭,10,生物});

语法gr =新语法(clist);

// DictationGrammar defaultDictationGrammar = new DictationGrammar();

// defaultD ictationGrammar.Name =默认听写;

//defaultDictationGrammar.Enabled = true;

试试

{

sre.RequestRecognizerUpdate();

sre.LoadGrammar(gr);

sre.SpeechRecognized + = sre_SpeechRecognized;

sre.SetInputToDefaultAudioDevice() ;

sre.RecognizeAsync(RecognizeMode.Multiple);

ss.SpeakAsync(欢迎来到vidwath,你要选择哪个类);



}

catch

{

MessageBox.Show(errror);

throw;

}



}



void sre_SpeechRecognized (对象发送者,SpeechRecognizedEventArgs e)

{

switch(e.Result.Text.ToString())

{

案例第一标准:

ss.SpeakAsync(欢迎来到第一标准,您要选择哪个主题);

class1.PerformClick();

break;

case10:

ss.SpeakAsync(欢迎来到第10个标准,哪个主题你想要选择);

webv.Source = new Uri(http://172.16.16.89/cbse/);

休息;



案例bio:

ss.SpeakAsync(欢迎来到第10个标准生物);

webv.Source = new Uri(http://172.16.16.89/cbse/course/index.php?categoryid=18);

休息;







案例第一数学:

ss.SpeakAsync(欢迎来到第一标准数学,你可以选择哪一章) ;

class1_M.PerformClick();

休息;



案例第1章:

ss。 SpeakAsync(欢迎来到第1章,你可以选择哪个选项);

Std1MT1.PerformClick();

休息;



caseVML:

ss.SpeakAsync(欢迎使用VML,返回使用命令返回);

Std1MT1VML.PerformClick ();

休息;



案例namaste:

ss.SpeakAsync(欢迎来到vidwath );



休息;



案例你好吗:

ss.SpeakAsync(罚款);

休息;



案例我能帮助你:

ss.SpeakAsync(请打开vidwath软件);

休息;



案例open vidwath english:

Process.Start(chrome,http://vidwath.com);

休息;



case 谢谢:

ss.SpeakAsync(欢迎,感谢您使用vidwath应用程序);

休息;







}

txtContent.Text + = e.Result.Text.ToString()+ Environment.NewLine;

}

----------------------------------- -------------------------------------------------- ---------------



当我通过在用户端复制调试文件夹来运行该程序时,语音检测是个大问题。当我们通过谷歌麦克风输入发出声音时,它正在拍摄,但在我们的应用程序中,语音输入无法正常工作。



第二个问题是当我提供输入时如果我说第一个标准它将作为第10个标准。



请提出建议以克服上述问题。



我尝试了什么:



复制C:\Program Files(x86)\参考Assemblies\Microsoft\Framework \\ \\ .NETFramework \v4.5到客户端系统。



在复制此音色之前根本没有检测到。复制后,这个声音被检测到,但输入的声音应该很大,精度也要低。

Speech recognition project in c# Voice detection problem at client system. Do we need to install any packages at user system?

I have created project in WPF with c# background for voice recognition. Code is :
-----------------------------------------------------------------------------------------------------
In XAML Voice function is called Loaded="BtnStart_Click"


Backend .cs code:

using System.Speech.Synthesis;
using System.Speech.Recognition;
using System.Diagnostics;

private void BtnStart_Click(object sender, RoutedEventArgs e)
{
btnStart.IsEnabled = false;
btnStop.IsEnabled = true;
clist.Add(new string[] { "search", "1st standard", "1st Maths", "Chapter 1", "VML", "namaste", "how are you", "how can i help you", "open vidwath english", "thank you", "close", "10", "bio" });
Grammar gr = new Grammar(clist);
//DictationGrammar defaultDictationGrammar = new DictationGrammar();
//defaultDictationGrammar.Name = "default dictation";
//defaultDictationGrammar.Enabled = true;
try
{
sre.RequestRecognizerUpdate();
sre.LoadGrammar(gr);
sre.SpeechRecognized += sre_SpeechRecognized;
sre.SetInputToDefaultAudioDevice();
sre.RecognizeAsync(RecognizeMode.Multiple);
ss.SpeakAsync("welcome to vidwath, which class you want to select");

}
catch
{
MessageBox.Show("errror");
throw;
}

}

void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
{
switch (e.Result.Text.ToString())
{
case "1st standard":
ss.SpeakAsync("welcome to 1st standard, which subject you want to select");
class1.PerformClick();
break;
case "10":
ss.SpeakAsync("welcome to 10th standard, which subject you want to select");
webv.Source = new Uri("http://172.16.16.89/cbse/");
break;

case "bio":
ss.SpeakAsync("welcome to 10th standard bio");
webv.Source = new Uri("http://172.16.16.89/cbse/course/index.php?categoryid=18");
break;



case "1st Maths":
ss.SpeakAsync("welcome to 1st standard Maths, which chapter you wnat to select");
class1_M.PerformClick();
break;

case "Chapter 1":
ss.SpeakAsync("welcome to chapter 1, which option you wnat to select");
Std1MT1.PerformClick();
break;

case "VML":
ss.SpeakAsync("welcome to VML, to go back use command go back");
Std1MT1VML.PerformClick();
break;

case "namaste":
ss.SpeakAsync("welcome to vidwath");

break;

case "how are you":
ss.SpeakAsync("Fine");
break;

case "how can i help you":
ss.SpeakAsync("please open vidwath software");
break;

case "open vidwath english":
Process.Start("chrome", "http://vidwath.com");
break;

case "thank you":
ss.SpeakAsync("welcome, thanks for using vidwath application");
break;



}
txtContent.Text += e.Result.Text.ToString() + Environment.NewLine;
}
----------------------------------------------------------------------------------------------------

When I run this program by copying debug folder in user end the voice detection is big problem. when we give voice through microphone input in google it is taking but in our application voice input is not working.

Second problem is when I give input If I say 1st Standard it will take as 10th Standard.

Please give suggestion to overcome above problem.

What I have tried:

Copied "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5" to client system.

Before copying this Voice was not detecting at all. After copying this voice got detected but input voice should be loud and accuracy is less.

推荐答案

你有两个问题:



1.您需要提供框架元素,有些可能不是标准元素。您最好的方法是运行一个安装程序,检查所需的软件包并在需要时安装它们。



2.当你使用时,你最终会挂钩硬件驱动程序这个系统;如果不对多种类型的硬件和驱动程序进行测试,很难确定您会看到什么样的质量。硬件降级(甚至像麦克风上的棉绒一样愚蠢)会对音质产生重大影响。没有硬性和快速的解决方法,您需要在不同的硬件上进行测试,并且理想情况下,优化您的检测算法。您可能还需要为服务添加培训期,以便考虑平台和用户之间的差异。
You have two issues:

1. You need to have your framework elements available, and some may not be standard. Your best route is to run an installer that checks for the needed packages and installs them if required.

2. You're ultimately hooking to a hardware driver when you use this system; and without testing against multiple types of hardware and drivers, it's hard to determine what sort of quality you'll see. Hardware degradation (or even something as silly as lint on a microphone) can have a major impact on sound quality. There is no hard and fast way to work around that, you'll need to test on different hardware and, ideally, refine your detection algorithm. You may need to add a training period to the service as well to account for differences between platforms and users.


这篇关于客户端系统中C#语音检测问题的语音识别项目。我们需要在用户系统安装任何软件包吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆