Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
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, 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
Posted
Comments
Sergey Alexandrovich Kryukov 23-Apr-11 22:02pm    
Why SpeechLib, not System.Speech?
--SA

1 solution

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!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900