tags:

views:

125

answers:

4

I want to write a simple Windows app in Visual C#/C++ that lets users input different segments of text, and then press a set of hotkeys to hear the various text segments in TTS at any time. The program should accept hotkeys while running in background or even when fullscreen applications have focus.

Example use case: user enters "hello world" and saves it as the first text segment, and then enters "stack overflow" and saves it as the second text segment. The user can switch to another program, then press hotkey CTRL-1 to hear the TTS say "hello world" or CTRL-2 to hear the TTS say "stack overflow." The program should of course be able to run entirely offline (just in case that affects any suggestions)

As a sidenote, I'm fairly new to programming in Visual whatever, but have a decent enough background in C#/C+, so even though I'm mainly looking for help on the TTS part, I'm open to suggestions of any kind if someone's done this kind of thing before.

A: 

There is an article about TTS in WPF on the MSDN here.

Jens
+2  A: 

if you want to talk something on C# use Introp.SpeechLib.dll

E.g:

private void ReadText()
        {
            int iCounter = 0;
            while (Convert.ToInt32(numericUpDown1.Value) > iCounter)
            {
                SpVoice spVoice = new SpVoice();
                spVoice.Speak("Hello World", SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak);
                spVoice.WaitUntilDone(Timeout.Infinite);
                iCounter = iCounter + 1;
            }
        }

read this: Speech Technologies

anishmarokey
Thanks! Interop.SpeechLib is turning out to be a pretty great solution for how simple to use it is.
birdyedwards
A: 

You have to use the Microsoft Speech SDK.

Have a look at this link for details:

http://dhavalshah.wordpress.com/2008/09/16/text-to-speech-in-c/

Russ C
A: 

Reference System.Speech.dll. You can instantiate a System.Speech.Synthesis.Synthesizer and call .Speak("TEXT HERE");

Mark H