Changing Default Bot Voice

yenching 11 Reputation points
2022-10-25T05:56:03.57+00:00

Hello im trying to change the default voice to aria, friendly, pitch -6%, rate +10%

This works for me

   var replyText = $"hi";  
   var replySpeak = @"<speak version='1.0' xmlns='https://www.w3.org/2001/10/synthesis' xml:lang='de-DE'>  
                   <voice name='Microsoft Server Speech Text to Speech Voice (en-US, Aria)'>" +  
                   $"{replyText}" + "</voice></speak>";  
   await turnContext.SendActivityAsync(MessageFactory.Text(replyText, replySpeak), cancellationToken);  

but when i add more customisations, it does not work anymore, instead it reads everything in replySpeak

   var replyText = $"Echo: {turnContext.Activity.Text}";  
   var replySpeak = @"<speak version='1.0' xmlns='https://www.w3.org/2001/10/synthesis' xml:lang='de-DE'>  
                   <voice name='Microsoft Server Speech Text to Speech Voice (de-DE, Stefan, Apollo)'><mstts:express-as   
                   style="cheerful"><prosody rate="+10%", pitch="-6%">" +  
                   $"{replyText}" + "</prosody></mstts:express-as></voice></speak>";  
   await turnContext.SendActivityAsync(MessageFactory.Text(replyText, replySpeak), cancellationToken);  
Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,813 questions
{count} votes

1 answer

Sort by: Most helpful
  1. yenching 11 Reputation points
    2022-10-27T07:15:40.81+00:00

    it works now, not sure why

       var replySpeak = @"<speak xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xmlns:emo='http://www.w3.org/2009/10/emotionml' version='1.0' xml:lang='en-US'><voice name='en-US-AriaNeural'><prosody rate='+1.00%' pitch='+1.00%'>"+$"{text}"+"</prosody></voice></speak>";  
    
    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.