none
How do I fix the speech synthesizer repeating itself c#? RRS feed

  • Question

  • So basically I used two speech recognition engines(speechrecog & speechrecog1) and one speech synthesizer. When the speechrecog is asked a question like how are you
    it then replies I am fine (if the computer picks 2 from the two numbers 1,2). Then it initializes the second speech recognition engine. When it does its stuff. It then turns the second one off and the first one on again. But the problem is when using the second speech recognition engine it repeats( speech synthesizer) the number of times I have tried the second speech recognition engine out.
    Here's my code for that form:

    http://pastebin.com/fXUws5gA
    For example:
        the text file how are you.txt contains:
        i am fine. thank you.% how are you#good#bad
    and the computer asks if im good and I reply with good. In the good.txt file:
    Oh thats cool

    the first time I ask her: How are you?

    Reply:I am fine thankyou. How are you

    User: good

    reply: Oh thats cool(1 time)


    the 2nd time I ask her: How are you?

    Reply:I am fine thankyou. How are you

    User: good

    reply: Oh thats cool(repeats it 2 times)


    the 3rd time I ask her: How are you?

    Reply:I am fine thankyou. How are you

    User: good

    reply: Oh thats cool(repeats it 3 times)




    How do i fix the repetition problem.



    • Edited by Mr.Danely Saturday, February 18, 2017 10:08 AM
    Saturday, February 18, 2017 10:00 AM

All replies

  • Hi Mr.Danely,

    Thank you for posting here.

    For your question, I use good for example. You could use speech to text to get the what you are saying and then compare the works in the text. Such as good, after comparing, read the good.txt file and use SpeechSynthesizer.speek() to say the works in .txt file.

    You could download the source file from the Speech recognition, speech to text, text to speech, and speech synthesis in C# in code project for reference of the use of speech to text and speech synthesis.

    I hope this would be helpful.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 20, 2017 8:31 AM
    Moderator