官术网_书友最值得收藏!

Empathy

When creating VUIs, you want to make the user feel as though they are talking to a real person. This develops empathy by making a connection with the user. First, empathy can be achieved by allowing the user to choose the voice they want to use. For example, in Google Assistant, the user can choose either a male or female voice by navigating to Settings | Preferences | Assistant voice, shown as follows:

Changing Google Assistant's voice

A second way is to programmatically control the voice using Speech Synthesis Markup Language (SSML), https://www.w3.org/TR/speech-synthesis/, which has been developed to generate synthetic voices for websites and other applications. With SSML, the response to the user can be controlled. Both Amazon Alexa and Google Dialogflow platforms support the use of SSML. Here are the most commonly used SSML tags and their usages in brief:

  • <break time="0.2s" />: Introduces a short pause between sentences.
  • <emphasis level="strong">Come here now!</emphasis>: Create speech that increases in volume and slows down, or decreases in volume and speeds up.
  • <prosody pitch="medium" rate="slow">great!!</prosody>: Used to customize the pitch, speech rate, and volume.
  • <p> Some paragraph goes here </p>: Similar to adding a long break between paragraphs.
  • <s> Some sentence goes here </s>: The equivalent of putting a period at the end to denote the end of the sentence in order to give a short pause.
  • <say-as interpret-as="cardinal">123</say-as>: Indicates the type of text. For example, the cardinal number 123 will be read as one hundred and twenty three. As for the ordinal number 123, it will be read as first, second, and third.
Both Amazon Alexa and Google Dialogflow support limited sets of SSML tags. Ensure that you check the SSML references for Amazon Alexa at http://amzn.to/2BGLt4M and Google Dialogflow at http://bit.ly/2BHBQmq. You will learn more in greater detail in Chapter 2Building an FAQs Chatbot.

Using SSML, let's create a speech that shows some excitement. You would not want the voice to be monotonous and boring. For example, sometimes you might want to show excitement, and to create such excitement, you can use prosody with a high pitch and slow rate, shown as follows. Also, when you emphasize the word love, you will be able to convey a sense of happiness. You can copy and paste the following SSML code at the Watson Text to Speech service interface, found at http://bit.ly/2AlAc9d. Enter the SSML and the voice will be played back:

<speak>
<p>
<s>
OK <prosody pitch="medium" rate="slow">great!!</prosody>
</s>
</p>
<break time="0.2s" />
<p>
<s>
I <emphasis level="strong">love</emphasis> to see you tomorrow!
</s>
</p>
</speak>

In order to test the SSML using http://bit.ly/2AlAc9d, it is best to use either the Firefox or Chrome browser.
主站蜘蛛池模板: 博湖县| 辽宁省| 洪湖市| 西宁市| 大悟县| 昌邑市| 青河县| 赞皇县| 藁城市| 万全县| 抚松县| 巨野县| 凉城县| 凯里市| 柳河县| 珠海市| 浑源县| 溧水县| 鹤壁市| 加查县| 通河县| 九江市| 张家界市| 湾仔区| 新巴尔虎右旗| 仪陇县| 临汾市| 永新县| 阳春市| 怀集县| 简阳市| 福建省| 团风县| 莱西市| 白城市| 张掖市| 嘉峪关市| 平果县| 蒙城县| 宣武区| 土默特右旗|