BotFramework-WebChat icon indicating copy to clipboard operation
BotFramework-WebChat copied to clipboard

How can I change the voice for the Text to speech feature?

Open mohit-jcc opened this issue 9 years ago • 4 comments

I am using the Speech recognition feature from the 'Speech' branch and I am able to do the conversion from text-to-speech as well as text-to-speech back.

However, I wish to be able to modify the voice used for the text-to-speech part as it is very robotic and unpleasant right now. Are there options to chose from? If not could you please provide some instructions on how to go about customising it.

Thanks

mohit-jcc avatar Jun 22 '17 10:06 mohit-jcc

@shahidkhuram @w-Yuan can you help?

danmarshall avatar Jun 22 '17 18:06 danmarshall

@mohit-jcc take a look at CognitiveServices.SpeechSynthesizer in latest sample sample: https://github.com/Microsoft/BotFramework-WebChat/blob/speech/samples/speech/index.html

This uses cognitive services for text to speech. You can pass the voiceName property to ICognitiveServicesSpeechSynthesisProperties to control which voice is used.

For the set of voices supported by cognitive services, please see https://docs.microsoft.com/en-us/azure/cognitive-services/Speech/api-reference-rest/bingvoiceoutput#a-namesuplocalesasupported-locales-and-voice-fonts

I'd suggest "Microsoft Server Speech Text to Speech Voice (en-US, JessaRUS)"

hope that helps.

shahidkhuram avatar Jun 22 '17 18:06 shahidkhuram

is there a way to change the rate the voice speaks at?

rodmcleay avatar Jul 09 '18 05:07 rodmcleay

You can control that using using the SSML that's sent to the speech service. Specifically, you can use the rate attribute on the prosody element: https://msdn.microsoft.com/en-us/library/office/hh361583(v=office.14).aspx

You can control this from your bot so that the SSML returned in the response contains the correct attribute. Alternatively, (thought not recommended), you could inspect and update the SSML in the webchat control as well if you want apply the speech-rate in the webchat instead of the bot.

shahidkhuram avatar Jul 10 '18 04:07 shahidkhuram