Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am making a LAN chat application with spoken messages using C#. I'm using SAPI 5.1, and I have encountered problem with speaking the messages. If I write the message "HI" his computer will receive the message and speak the word "HI" which is OK, but if I write a new message for example "HELLO" his computer will repeat speaking the first message "HI" and then speak the word "HELLO".

The old message "HI" should not be repeated again, and it should say the new message "HELLO".

Here is my code:

C#
private void rtbConversation_TextChanged(object sender, EventArgs e)
{
    speech.Rate = speechRate;
    speech.Speak(rtbConversation.Text, SpeechVoiceSpeakFlags.SVSFlagsAsync);

    speech.Voice = speech.GetVoices(string.Empty, 
                          string.Empty).Item(combo1.SelectedIndex); 
}
Posted
Updated 25-Jan-12 3:27am
v2

1 solution

Sounds like you are not clearing the incoming text buffer
 
Share this answer
 
Comments
odolskie 25-Jan-12 10:04am    
I want it that the already spoken word or text would not speak anymore by not clearing the textbox also all message are in one textbox.

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