-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Direct Line Speech support #2621
Merged
Merged
Changes from all commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
2cc1d9e
Indicate a speech-related post activity
compulim beda217
Bump to [email protected]
compulim d61870b
Bump to [email protected]
compulim 22ad6e0
Update ponyfill signature
compulim 6cf4124
Fix ESLint
compulim b1027cc
Rename to speechSynthesisUtterance
compulim ee7f6c5
Add directlinespeech-sdk package
compulim c72ef0e
Fix ESLint
compulim 94db857
Fix abort synthesis
compulim 264d02f
Fix error thrown for non-speaking utterance
compulim f99ac05
Fix ESLint
compulim 6abc47f
Clean up
compulim ac5cbce
Should not send user ID
compulim 9c54ae3
Optional OAuth support
compulim ab8d776
Use fetchCredentials instead of token/key
compulim 9fe16f5
Renew token
compulim 2386085
Warning on telemetry option
compulim e313221
Update sample
compulim d6d9a2c
Add README.md
compulim 1aa87e4
Remove cache part
compulim cab21bd
Improve error handling and concurrency
compulim a7eb859
Error handling and concurrency
compulim d33cf5b
Fix bad merge
compulim 30dc281
Disable microphone button if recognition is not abortable
compulim df35bce
Add entry
compulim ac968f0
Add entry
compulim cf0bed7
Update sample
compulim 6530c63
Fix build error
compulim c358f5f
Fix SHA on tarball
compulim a483654
Add Markdown
compulim ab2acd5
Applying PR changes
compulim f57ae76
Apply PR comments
compulim 1cf9fdc
Apply PR comments
compulim 11aec11
Fix ESLint
compulim 6adf78e
Add math-random
compulim fe801a3
Apply suggestions from code review
compulim ee14753
Apply suggestions from code review
compulim 2208e1b
Use constructor
compulim 5efa368
Apply suggestions from code review
compulim 415d550
Applying PR comment
compulim f7aaa71
Remove commented out part
compulim 6c4a6d3
Add BYO ponyfill and audioContext
compulim 85e69f7
Update props
compulim 41092ce
Update token fetch
compulim 11b3c85
Fix test
compulim 50336ad
Fix test
compulim fb4ad40
Update entry
compulim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. | |
- Fixes [#2597](https://github.com/microsoft/BotFramework-WebChat/issues/2597). Modify `watch` script to `start` and add `tableflip` script for throwing `node_modules`, by [@corinagum](https://github.com/corinagum) in PR [#2598](https://github.com/microsoft/BotFramework-WebChat/pull/2598) | ||
- Adds Arabic Language Support, by [@midineo](https://github.com/midineo), in PR [#2593](https://github.com/microsoft/BotFramework-WebChat/pull/2593) | ||
- Adds `AdaptiveCardsComposer` and `AdaptiveCardsContext` for composability for Adaptive Cards, by [@compulim](https://github.com/compulim), in PR [#2648](https://github.com/microsoft/BotFramework-WebChat/pull/2648) | ||
- Adds Direct Line Speech support, by [@compulim](https://github.com/compulim) in PR [#2621](https://github.com/microsoft/BotFramework-WebChat/pull/2621) | ||
|
||
### Fixed | ||
|
||
|
@@ -68,7 +69,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. | |
|
||
### Changed | ||
|
||
- Bumped all dependencies to latest version, by [@compulim](https://github.com/compulim), in PR [#2533](https://github.com/microsoft/BotFramework-WebChat/pull/2533) | ||
- Bumped all dependencies to latest version, by [@compulim](https://github.com/compulim), in PR [#2533](https://github.com/microsoft/BotFramework-WebChat/pull/2533) and PR [#2621](https://github.com/microsoft/BotFramework-WebChat/pull/2621) | ||
- Development dependencies | ||
- Root package | ||
- `@azure/[email protected]` | ||
|
@@ -132,6 +133,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. | |
- `component` | ||
- `[email protected]` | ||
- `[email protected]` | ||
- `[email protected]` | ||
- `[email protected]` | ||
- `[email protected]` | ||
- `[email protected]` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,228 @@ | ||
# Using Direct Line Speech | ||
|
||
> For Cognitive Services Speech Services, please refer to [`SPEECH.md`](https://github.com/microsoft/BotFramework-WebChat/blob/master/SPEECH.md). | ||
|
||
This guide is for integrating Direct Line Speech. | ||
|
||
We assume you have already set up a bot and have Web Chat running on a page. | ||
|
||
> Sample code in this article is optimized for modern browsers. You may need to use a [transpiler](https://en.wikipedia.org/wiki/Source-to-source_compiler) (e.g. [Babel](https://babeljs.io/)) to target a broader range of browsers. | ||
|
||
## Support matrix | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th></th> | ||
<th></th> | ||
<th colspan="2">Chrome/Edge<br />and Firefox<br />on desktop</th> | ||
<th colspan="2">Chrome<br />on Android</th> | ||
<th colspan="2">Safari<br />on macOS/iOS</th> | ||
<th colspan="2"><a href="https://developer.android.com/reference/android/webkit/WebView">Web View<br />on Android</a></th> | ||
<th colspan="2"><a href="https://developer.apple.com/documentation/webkit/wkwebview">Web View<br />on iOS</a></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr> | ||
<td>STT</td> | ||
<td>Basic recognition</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>❌</th><td><a href="#notes-1"><sup>*1</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>STT</td> | ||
<td><a href="#custom-speech">Custom Speech</a></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td><a href="#notes-1"><sup>*1</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>STT</td> | ||
<td><a href="#text-normalization-options">Text normalization options</a></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td><a href="#notes-1"><sup>*1</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>STT</td> | ||
<td>Abort recognition</td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td><a href="#notes-1"><sup>*1</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>STT</td> | ||
<td>Interims</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>❌</th><td><a href="#notes-1"><sup>*1</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>STT</td> | ||
<td>Dynamic priming</td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td><a href="#notes-1"><sup>*1</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>STT</td> | ||
<td>Reference grammar ID</td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td><a href="#notes-1"><sup>*1</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>STT</td> | ||
<td>Select language at initialization</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>❌</th><td><a href="#notes-1"><sup>*1</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>STT</td> | ||
<td>Select language on-the-fly</td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td><a href="#notes-1"><sup>*1</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>STT</td> | ||
<td><a href="#using-input-hint">Input hint</a></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td><a href="#notes-1"><sup>*1</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>STT</td> | ||
<td>Select input device</td> | ||
<th>❌</th><td><a href="#notes-3"><sup>*3</sup></a></td> | ||
<th>❌</th><td><a href="#notes-3"><sup>*3</sup></a></td> | ||
<th>❌</th><td><a href="#notes-3"><sup>*3</sup></a></td> | ||
<th>❌</th><td><a href="#notes-3"><sup>*3</sup></a></td> | ||
<th>❌</th><td><a href="#notes-1"><sup>*1</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>TTS</td> | ||
<td>Basic synthesis using text</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>❓</th><td><a href="#notes-2"><sup>*2</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>TTS</td> | ||
<td><a href="#using-speech-synthesis-markup-language">Speech Synthesis Markup Language</a></td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>❓</th><td><a href="#notes-2"><sup>*2</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>TTS</td> | ||
<td><a href="#custom-voice">Custom Voice</a></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❓</th><td><a href="#notes-2"><sup>*2</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>TTS</td> | ||
<td><a href="#selecting-voice">Selecting voice/pitch/rate/volume</a></td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>❓</th><td><a href="#notes-2"><sup>*2</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>TTS</td> | ||
<td><a href="#text-to-speech-audio-format">Text-to-speech audio format</a></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❓</th><td><a href="#notes-2"><sup>*2</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>TTS</td> | ||
<td>Stripping text from Markdown</td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❓</th><td><a href="#notes-2"><sup>*2</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>TTS</td> | ||
<td>Override using "speak" property</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>❓</th><td><a href="#notes-2"><sup>*2</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>TTS</td> | ||
<td>Adaptive Cards using "speak" property</td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❓</th><td><a href="#notes-2"><sup>*2</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>TTS</td> | ||
<td>Interrupt synthesis when clicking on microphone button (<a href="https://github.com/microsoft/BotFramework-WebChat/issues/2428">Bug</a>) (<a href="https://github.com/microsoft/BotFramework-WebChat/pull/2429">PR</a>)</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>✔</th><td>4.7</td> | ||
<th>❓</th><td><a href="#notes-2"><sup>*2</sup></a></td> | ||
</tr> | ||
<tr> | ||
<td>TTS</td> | ||
<td>Synthesize activity with multiple attachments</td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❌</th><td></td> | ||
<th>❓</th><td><a href="#notes-2"><sup>*2</sup></a></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
### Notes | ||
|
||
1. <a name="notes-1"></a>[Web View on iOS](https://developer.apple.com/documentation/webkit/wkwebview) is not a full browser. It does not have audio recording capabilities, which is required for Cognitive Services | ||
2. <a name="notes-2"></a>As speech recognition is not working (see above), speech synthesis is not tested | ||
3. <a name="notes-3"></a>Cognitive Services currently has a bug on selecting a different device for audio recording | ||
- Currently blocked by https://github.com/microsoft/cognitive-services-speech-sdk-js/issues/96 | ||
- Tracking bug at https://github.com/microsoft/BotFramework-WebChat/issues/2481 | ||
|
||
## Requirements | ||
|
||
Direct Line Speech shares the same requirements as Cognitive Services Speech Services. Please refer to [`SPEECH.md`](https://github.com/microsoft/BotFramework-WebChat/blob/master/SPEECH.md#requirements). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { createAdapters } from 'botframework-directlinespeech-sdk'; | ||
|
||
export default function createDirectLineSpeechAdapters(...args) { | ||
return createAdapters(...args); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the value of this re-export??