diff --git a/README.md b/README.md index 34f751b05d..f5e042b618 100644 --- a/README.md +++ b/README.md @@ -186,7 +186,7 @@ In issue [#2022](https://github.com/microsoft/BotFramework-WebChat/issues/2022), | [`06.d.speech-web-browser`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/06.d.speech-web-browser) | Demonstrates how to implement text-to-speech using Web Chat's browser-based Web Speech API. (link to W3C standard in the sample) | [Web Speech API Demo](https://microsoft.github.io/BotFramework-WebChat/06.d.speech-web-browser) | | [`06.e.cognitive-services-speech-services-with-lexical-result`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/06.e.cognitive-services-speech-services-with-lexical-result) | Demonstrates how to use lexical result from Cognitive Services Speech Services API. | [Lexical Result Demo](https://microsoft.github.io/BotFramework-WebChat/06.e.cognitive-services-speech-services-with-lexical-result) | | [`06.f.hybrid-speech`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/06.f.hybrid-speech) | Demonstrates how to use both browser-based Web Speech API for speech-to-text, and Cognitive Services Speech Services API for text-to-speech. | [Hybrid Speech Demo](https://microsoft.github.io/BotFramework-WebChat/06.f.hybrid-speech) | -| [`06.g.select-voice`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/06.g.select-voice) | Demonstrates how to select speech synthesis voice based on activity. | [Hybrid Speech Demo](https://microsoft.github.io/BotFramework-WebChat/06.g.select-voice) | +| [`06.g.select-voice`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/06.g.select-voice) | Demonstrates how to select speech synthesis voice based on activity. | [Select Voice Demo](https://microsoft.github.io/BotFramework-WebChat/06.g.select-voice) | | [`07.a.customization-timestamp-grouping`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/07.a.customization-timestamp-grouping) | Demonstrates how to customize timestamps by showing or hiding timestamps and changing the grouping of messages by time. | [Timestamp Grouping Demo](https://microsoft.github.io/BotFramework-WebChat/07.a.customization-timestamp-grouping) | | [`07.b.customization-send-typing-indicator`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/07.b.customization-send-typing-indicator) | Demonstrates how to send typing activity when the user start typing on the send box. | [User Typing Indicator Demo](https://microsoft.github.io/BotFramework-WebChat/07.b.customization-send-typing-indicator) | | [`08.customization-user-highlighting`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/08.customization-user-highlighting) | Demonstrates how to customize the styling of activities based whether the message is from the user or the bot. | [User Highlighting Demo](https://microsoft.github.io/BotFramework-WebChat/08.customization-user-highlighting) | diff --git a/packages/component/src/defaultSelectVoice.js b/packages/component/src/defaultSelectVoice.js index dfe700fd96..93a9d99eb7 100644 --- a/packages/component/src/defaultSelectVoice.js +++ b/packages/component/src/defaultSelectVoice.js @@ -6,7 +6,7 @@ export default function({ language }, voices, activity) { // 4. English (United States) // 5. First voice - // We also prefer voice powered by deep neural network (with keyword "neural" in the voice name). + // We also prioritize voices powered by deep neural network (with keyword "neural" in the voice name). return ( [activity.locale, language, window.navigator.language, 'en-US'].reduce( (result, targetLanguage) => diff --git a/samples/06.g.select-voice/README.md b/samples/06.g.select-voice/README.md index e93456f1c6..b0bbb7522d 100644 --- a/samples/06.g.select-voice/README.md +++ b/samples/06.g.select-voice/README.md @@ -2,7 +2,7 @@ ## Description -A simple page with Web Chat integrated with speech-to-text and text-to-speech functionality and select different voices based on the activity to be synthesized. +A simple page with Web Chat integrated with speech-to-text and text-to-speech functionality that selects different voices based on the activity to be synthesized. This is an extension of sample [06.c.cognitive-services-speech-services-js](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/06.c.cognitive-services-speech-services-js). @@ -30,11 +30,11 @@ This is an extension of sample [06.c.cognitive-services-speech-services-js](http ## Selecting voice -To select different voice used for speech synthesis, pass a `selectVoice` function when creating Web Chat. +To select a different voice for speech synthesis, pass a `selectVoice` function when creating Web Chat. -When Web Chat synthesize an activity, it will call the `selectVoice` function with list of voices available and the activity to be synthesized. The code should return the `SpeechSynthesisVoice` object to use for speech synthesis. +When Web Chat synthesizes an activity, it will call the `selectVoice` function with a list of voices available and the activity to be synthesized. The code should return the `SpeechSynthesisVoice` object to use for speech synthesis. -In the sample code below, if the activity is for language "zh-HK", we will use a voice with keyword "TracyRUS". Otherwise, it will prefer a voice with keyword "JessaNeural" over "Jessa". +In the sample code below, if the activity is for language "zh-HK", we will use a voice with keyword "TracyRUS". Otherwise, it will choose a voice with keyword "JessaNeural" over "Jessa". ```diff const directLineTokenResponse = await fetch('https://webchat-mockbot.azurewebsites.net/directline/token', { method: 'POST' }); diff --git a/samples/README.md b/samples/README.md index 348b31bab8..25acbe3fee 100644 --- a/samples/README.md +++ b/samples/README.md @@ -27,7 +27,7 @@ Here you can find all hosted samples of [Web Chat](https://github.com/microsoft/ | [`06.d.speech-web-browser`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/06.d.speech-web-browser) | Demonstrates how to implement text-to-speech using Web Chat's browser-based Web Speech API. (link to W3C standard in the sample) | [Web Speech API Demo](https://microsoft.github.io/BotFramework-WebChat/06.d.speech-web-browser) | | [`06.e.cognitive-services-speech-services-with-lexical-result`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/06.e.cognitive-services-speech-services-with-lexical-result) | Demonstrates how to use lexical result from Cognitive Services Speech Services API. | [Lexical Result Demo](https://microsoft.github.io/BotFramework-WebChat/06.e.cognitive-services-speech-services-with-lexical-result) | | [`06.f.hybrid-speech`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/06.f.hybrid-speech) | Demonstrates how to use both browser-based Web Speech API for speech-to-text, and Cognitive Services Speech Services API for text-to-speech. | [Hybrid Speech Demo](https://microsoft.github.io/BotFramework-WebChat/06.f.hybrid-speech) | -| [`06.g.select-voice`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/06.g.select-voice) | Demonstrates how to select speech synthesis voice based on activity. | [Hybrid Speech Demo](https://microsoft.github.io/BotFramework-WebChat/06.g.select-voice) | +| [`06.g.select-voice`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/06.g.select-voice) | Demonstrates how to select speech synthesis voice based on activity. | [Select Voice Demo](https://microsoft.github.io/BotFramework-WebChat/06.g.select-voice) | | [`07.a.customization-timestamp-grouping`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/07.a.customization-timestamp-grouping) | Demonstrates how to customize timestamps by showing or hiding timestamps and changing the grouping of messages by time. | [Timestamp Grouping Demo](https://microsoft.github.io/BotFramework-WebChat/07.a.customization-timestamp-grouping) | | [`07.b.customization-send-typing-indicator`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/07.b.customization-send-typing-indicator) | Demonstrates how to send typing activity when the user start typing on the send box. | [User Typing Indicator Demo](https://microsoft.github.io/BotFramework-WebChat/07.b.customization-send-typing-indicator) | | [`08.customization-user-highlighting`](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/08.customization-user-highlighting) | Demonstrates how to customize the styling of activities based whether the message is from the user or the bot. | [User Highlighting Demo](https://microsoft.github.io/BotFramework-WebChat/08.customization-user-highlighting) |