Here's a code from the C# Windows Form

SpeechSynthesizer audio = new SpeechSynthesizer();
                           
             audio.Speak(textBox1.Text);

- This will read anything that is in the textbox

Problem in trying to implement the pause and stop feature.Any button or menuitem doesnt get clicked when the code reads something

public void button1_Click(object sender, EventArgs e)
        {
            //Nothing gets executed here when the code is reading
        }

i just read there is SpeakProgressEventArgs
http://msdn.microsoft.com/en-us/library/system.speech.synthesis.speakprogresseventargs%28VS.85%29.aspx

i tried synth...asyncancel... but the click event of the button doesnt get executed

problem solved using

SpeakAsync()  SpeakAsyncCancelAll()

I'm glad you got it working. Please mark this thread as solved if you have found an answer to your question and good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.