Add documentation of flow of information for Text-to-Speech on Chrome/CROS.
NOTRY=true TBR=dmazzoni@chromium.org Change-Id: I52c8cb2287f31554f5c6faab740ebd701b135eed Reviewed-on: https://chromium-review.googlesource.com/1013693 Commit-Queue: Katie Dektar <katie@chromium.org> Reviewed-by: Katie Dektar <katie@chromium.org> Cr-Commit-Position: refs/heads/master@{#551355}
This commit is contained in:
docs
@ -280,6 +280,10 @@ used when committed.
|
||||
feedback (ChromeVox) on Chrome OS.
|
||||
* [ChromeVox on Desktop Linux](accessibility/chromevox_on_desktop_linux.md) -
|
||||
Enabling spoken feedback (ChromeVox) on desktop Linux.
|
||||
* [Offscreen, Invisible and Size](accessibility/offscreen.md) - How Chrome
|
||||
defines offscreen, invisible and size in the accessibility tree.
|
||||
* [Text to Speech](accessibility/tts.md) - Overview of text to speech in
|
||||
Chrome and Chrome OS.
|
||||
* [BRLTTY in Chrome OS](accessibility/brltty.md) - Chrome OS integration with
|
||||
BRLTTY to support refreshable braille displays
|
||||
* [PATTS on Chrome OS](accessibility/patts.md) - Notes on the PATTS speech
|
||||
|
@ -6,6 +6,7 @@
|
||||
## Cross-Platform
|
||||
|
||||
* [Offscreen, Invisible and Size](accessibility/offscreen.md)
|
||||
* [Text to Speech in Chrome and Chrome OS](accessibility/tts.md)
|
||||
|
||||
## Chrome OS
|
||||
|
||||
|
@ -3,6 +3,8 @@
|
||||
Chrome OS comes with a speech synthesis engine developed internally at Google
|
||||
called PATTS. It's based on the same engine that ships with all Android devices.
|
||||
|
||||
[Read more about Text-to-Speech in Chrome](tts.md).
|
||||
|
||||
## Building from source
|
||||
|
||||
This is for Googlers only.
|
||||
|
52
docs/accessibility/tts.md
Normal file
52
docs/accessibility/tts.md
Normal file
@ -0,0 +1,52 @@
|
||||
# Text to Speech in Chrome and Chrome OS
|
||||
|
||||
Chrome and Chrome OS allow developers to produce synthesized speech. This
|
||||
document is an overview of the relevant code and code structure around
|
||||
synthesized speech.
|
||||
|
||||
## Code structure
|
||||
|
||||
A brief outline of the flow from speech request to the resulting speech on any
|
||||
platform.
|
||||
|
||||
### Input
|
||||
|
||||
- chrome.tts extension API
|
||||
|
||||
- The [chrome.tts extension API](https://developer.chrome.com/apps/tts)
|
||||
allows extensions to request speech across Windows, Mac or Chrome OS, using
|
||||
native speech synthesis.
|
||||
|
||||
- Input to the extension is first processed in the
|
||||
[TtsExtensionApi](https://cs.chromium.org/chromium/src/chrome/browser/speech/extension_api/tts_extension_api.h).
|
||||
|
||||
- The extension is passed an [Options object](https://developer.chrome.com/apps/tts#method-speak)
|
||||
in chrome.tts.speak, which is translated into a
|
||||
[tts_controller Utterance](https://cs.chromium.org/chromium/src/chrome/browser/speech/tts_controller.h?dr=CSs&l=130).
|
||||
|
||||
- Web Speech API
|
||||
|
||||
- Chrome implements
|
||||
[Window.SpeechSynthesis](https://developer.mozilla.org/en-US/docs/Web/API/Window/speechSynthesis)
|
||||
from the [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API).
|
||||
This allows web apps to do text-to-speech via the device's speech
|
||||
synthesizer.
|
||||
|
||||
- A [WebSpeechSynthesisUtterance](https://cs.chromium.org/chromium/src/third_party/blink/public/platform/web_speech_synthesis_utterance.h)
|
||||
is created by window.SpeechSynthesis
|
||||
|
||||
### Processing
|
||||
|
||||
- The [TtsController](https://cs.chromium.org/chromium/src/chrome/browser/speech/tts_controller.h) processes utterances and sends them to the correct output engine
|
||||
|
||||
### Output
|
||||
|
||||
- May differ by system, including Mac, Wind, Android, Arc++, and Chrome OS
|
||||
|
||||
- In Chrome OS:
|
||||
|
||||
- [TtsEngineExtensionAPI](https://cs.chromium.org/chromium/src/chrome/browser/speech/extension_api/tts_engine_extension_api.h)
|
||||
forwards speech events to PATTS, or the network speech engine, or,
|
||||
coming soon, third-party speech engines.
|
||||
|
||||
- [PATTS](patts.md) is the built-in Chrome OS text-to-speech engine.
|
Reference in New Issue
Block a user