Search code examples
botframeworktext-to-speech

How to avoid pronounciation of ' in the text when speaking it


I am building a bot with speaking services and connected with QnA services. I have some text to be spoken with single quote in it.

When the bot speaks the text, for example: "I don't have a family".

It pronounces it as:

I don backslash t have a family.

How to avoid such reading in speech service. I tried to find out some SSML markup tags but it didn't work with me.

can someone help to figure it out what shall I try?

thanks, Vivek


Solution

  • If it speaks "I don backslash t have a family" then the input text does contain a backslash instead of '. Words like haven't, wouldn't, don't are correctly interpreted by text to speech.

    As pointed out in the comments, the questioner is using QnA maker and doing some string replacements before outputting it.

    Due to the nature of QnA maker editor, such things happen quite often as QnA maker editor supports a few formatting options as discussed here.

    Whenever using QnA maker responses and routing it directly to a voice-enabled channel, make sure that you escape it in some ways.