Skip to content

Commit

Permalink
Applies PR review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim committed Sep 27, 2019
1 parent 1a2f767 commit 242ffac
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions samples/06.c.cognitive-services-speech-services-js/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
let lastResult = {};

return async () => {
// Fetch a new token if the existing is expiring.
// Fetch a new token if the existing one is expiring.
// The following article mentioned the token is only valid for 10 minutes.
// We will invalidate the token after 5 minutes.
// https://docs.microsoft.com/en-us/azure/cognitive-services/authentication#authenticate-with-an-authentication-token
Expand Down Expand Up @@ -72,7 +72,7 @@
const res = await fetch('https://webchat-mockbot.azurewebsites.net/directline/token', { method: 'POST' });
const { token } = await res.json();

// Create the ponyfill factory function, that can be called to create a concrete implementation of the ponyfill.
// Create the ponyfill factory function, which can be called to create a concrete implementation of the ponyfill.
const webSpeechPonyfillFactory = await window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory({
// We are passing the Promise function to the authorizationToken field.
// This function will be called every time the token is being used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
let lastResult = {};

return async () => {
// Fetch a new token if the existing is expiring.
// Fetch a new token if the existing one is expiring.
// The following article mentioned the token is only valid for 10 minutes.
// We will invalidate the token after 5 minutes.
// https://docs.microsoft.com/en-us/azure/cognitive-services/authentication#authenticate-with-an-authentication-token
Expand Down Expand Up @@ -72,7 +72,7 @@
const res = await fetch('https://webchat-mockbot.azurewebsites.net/directline/token', { method: 'POST' });
const { token } = await res.json();

// Create the ponyfill factory function, that can be called to create a concrete implementation of the ponyfill.
// Create the ponyfill factory function, which can be called to create a concrete implementation of the ponyfill.
const webSpeechPonyfillFactory = await window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory({
// We are passing the Promise function to the authorizationToken field.
// This function will be called every time the token is being used.
Expand Down
4 changes: 2 additions & 2 deletions samples/06.f.hybrid-speech/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
let lastResult = {};

return async () => {
// Fetch a new token if the existing is expiring.
// Fetch a new token if the existing one is expiring.
// The following article mentioned the token is only valid for 10 minutes.
// We will invalidate the token after 5 minutes.
// https://docs.microsoft.com/en-us/azure/cognitive-services/authentication#authenticate-with-an-authentication-token
Expand Down Expand Up @@ -82,7 +82,7 @@

// We are creating a hybrid ponyfill factory that will merge the result of two ponyfill factories together.
async function createHybridPonyfillFactory({ authorizationToken, region }) {
// Create the ponyfill factory function, that can be called to create a concrete implementation of the ponyfill.
// Create the ponyfill factory function, which can be called to create a concrete implementation of the ponyfill.
const speechServicesPonyfillFactory = await window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory(
{
// We are passing the Promise function to the authorizationToken field.
Expand Down
4 changes: 2 additions & 2 deletions samples/06.g.select-voice/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
let lastResult = {};

return async () => {
// Fetch a new token if the existing is expiring.
// Fetch a new token if the existing one is expiring.
// The following article mentioned the token is only valid for 10 minutes.
// We will invalidate the token after 5 minutes.
// https://docs.microsoft.com/en-us/azure/cognitive-services/authentication#authenticate-with-an-authentication-token
Expand Down Expand Up @@ -74,7 +74,7 @@
});
const { token } = await directLineTokenResponse.json();

// Create the ponyfill factory function, that can be called to create a concrete implementation of the ponyfill.
// Create the ponyfill factory function, which can be called to create a concrete implementation of the ponyfill.
const webSpeechPonyfillFactory = await window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory({
// We are passing the Promise function to the authorizationToken field.
// This function will be called every time the token is being used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A simple web page that uses speech-to-text only and disable text-to-speech. This

# Test out the hosted sample

- [Try out MockBot](https://microsoft.github.io/BotFramework-WebChat/06.f.hybrid-speech)
- [Try out MockBot](https://microsoft.github.io/BotFramework-WebChat/06.h.cognitive-services-speech-recognition-only)

# How to run locally

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
This CDN points to the latest official release of Web Chat. If you need to test against Web Chat's latest bits, please refer to pointing to Web Chat's MyGet feed:
https://github.com/microsoft/BotFramework-WebChat#how-to-test-with-web-chats-latest-bits
-->
<!-- <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script> -->
<script src="/webchat.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
<style>
html,
body {
Expand All @@ -36,7 +35,7 @@
let lastResult = {};

return async () => {
// Fetch a new token if the existing is expiring.
// Fetch a new token if the existing one is expiring.
// The following article mentioned the token is only valid for 10 minutes.
// We will invalidate the token after 5 minutes.
// https://docs.microsoft.com/en-us/azure/cognitive-services/authentication#authenticate-with-an-authentication-token
Expand Down Expand Up @@ -81,13 +80,13 @@
method: 'POST'
});

// We are creating a ponyfill factory that will only return the speech recognition part.
// We are creating a ponyfill factory that will only return speech recognition part.
async function createSpeechRecognitionOnlyPonyfillFactory() {
// Create the ponyfill factory function, that can be called to create a concrete implementation of the ponyfill.
// Create the ponyfill factory function, which can be called to create a concrete implementation of the ponyfill.
const speechServicesPonyfillFactory = await window.WebChat.createCognitiveServicesSpeechServicesPonyfillFactory(
{
// We are passing the Promise function to the authorizationToken field.
// This function will be called every time the token is being used.
// This function will be called every time the token is used.
authorizationToken: fetchSpeechServicesToken,

// In contrast, we are only fetching the region once.
Expand Down

0 comments on commit 242ffac

Please sign in to comment.