在C#中使用MS Speech SDK [英] Working with the MS Speech SDK in C#

查看:270
本文介绍了在C#中使用MS Speech SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#中的Speeach SDK来玩TTS,发现它非常简单

示例(C#中的全功能TTS程序):

Hi, I am playing around with TTS using the Speeach SDK in C#, and I found it very simple

example(fully functional TTS program in C#):

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SpeechLib;
namespace SpeechTest1
{
    class Program
    {
        static void Main(string[] args)
        {
            string text1 = "";
            Console.WriteLine("Write text you want read");
            text1 = Console.ReadLine();
            SpVoice spVoice = new SpVoice();
            SpeechVoiceSpeakFlags svsp = new SpeechVoiceSpeakFlags();
            spVoice.Speak(text1, svsp);
            Console.ReadLine(); //Pause
        }
    }
}



BUUUT一直在MSDN上四处搜寻,并且在Google上搜索了很多内容,所以我找不到一个简单的程序来演示如何收听语音命令.这里有一个关于代码项目"的示例,但是它非常笨拙,几乎没有让我了解正在发生的事情,对于像我这样的菜鸟来说,它并不是很有用.

如果这很简单,谁能给我示范一种使语音命令可以被程序理解的方法吗?我将使用自定义语法而不是标准的听写语法(如果有帮助的话).

我以为这是一件简单的事情,请让我知道,如果使用Speech SDK进行计算机聆听比使用TTS复杂一个数量级,那么我不会为此而费解.

感谢您提供的所有帮助.

-frank



BUUUT, having been looking around on MSDN, and googled quite a bit I can''t find a simple program to demonstrate listening for voice commands. There was one example here on ''code project'' but it was just stupidly big and gave me little or no understanding of what was happening, it just wasn''t very useful for a noob like me.

If it is at all simple, could anyone show me a way to make a voice command be understood by a program? I will be using a custom grammar and not the standard one for dictation (if that is helpful).

I am assuming that this is a simple thing, please let me know if making a computer listen using the Speech SDK is an order of magnitude more complicated than using TTS, then I will not take water over my head with this.

I appreciate any and all help with this.

-frank

推荐答案

当然很复杂!
但是您可能已经找到了一个非常简单的示例:Google"system.speech示例",而MSDN在列表中居首位:
http://msdn.microsoft.com/en-us/library/bb608250.aspx [ ^ ]-该示例可能并不简单两种方法都可以(因为您必须下载一个项目,而不仅仅是看一小段代码),但是它应该可以直接使用.

不要害怕复杂性,也不要以为任何复杂的事物都只是愚蠢的大事"-有很大的必要性!
Of course it is complicated!
But you could have found an example quite simply: Google "system.speech example" and MSDN is top of the list:
http://msdn.microsoft.com/en-us/library/bb608250.aspx[^] - the example is probably not simple either (given you have to download a project rather than just look at a brief bit of code) but it should work straight out of the box.

Don''t be afraid of complexity, and don''t assume that anything complex is "just stupidly big" - there is a good chance that it needs to be!


这篇关于在C#中使用MS Speech SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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