OLD | NEW |
1 <p id="classSummary"> | |
2 Use the <code>chrome.ttsEngine</code> module to | |
3 implement a text-to-speech (TTS) engine using an extension. If your | |
4 extension registers using this API, it will receive events containing | |
5 an utterance to be spoken and other parameters when any extension or packaged | |
6 app uses the | |
7 <a href="tts.html">tts</a> | |
8 module to generate speech. Your extension can then use any available | |
9 web technology to synthesize and output the speech, and send events back | |
10 to the calling function to report the status. | |
11 </p> | |
12 | |
13 | |
14 <h2 id="overview">Overview</h2> | 1 <h2 id="overview">Overview</h2> |
15 | 2 |
16 <p>An extension can register itself as a speech engine. By doing so, it | 3 <p>An extension can register itself as a speech engine. By doing so, it |
17 can intercept some or all calls to functions such as | 4 can intercept some or all calls to functions such as |
18 $ref:tts.speak and | 5 $ref:tts.speak and |
19 $ref:tts.stop | 6 $ref:tts.stop |
20 and provide an alternate implementation. | 7 and provide an alternate implementation. |
21 Extensions are free to use any available web technology | 8 Extensions are free to use any available web technology |
22 to provide speech, including streaming audio from a server, HTML5 audio, | 9 to provide speech, including streaming audio from a server, HTML5 audio, |
23 Native Client, or Flash. An extension could even do something different | 10 Native Client, or Flash. An extension could even do something different |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 If your extension does not register listeners for both | 133 If your extension does not register listeners for both |
147 <code>onSpeak</code> and <code>onStop</code>, it will not intercept any | 134 <code>onSpeak</code> and <code>onStop</code>, it will not intercept any |
148 speech calls, regardless of what is in the manifest.</p> | 135 speech calls, regardless of what is in the manifest.</p> |
149 | 136 |
150 <p>The decision of whether or not to send a given speech request to an | 137 <p>The decision of whether or not to send a given speech request to an |
151 extension is based solely on whether the extension supports the given voice | 138 extension is based solely on whether the extension supports the given voice |
152 parameters in its manifest and has registered listeners | 139 parameters in its manifest and has registered listeners |
153 for <code>onSpeak</code> and <code>onStop</code>. In other words, | 140 for <code>onSpeak</code> and <code>onStop</code>. In other words, |
154 there's no way for an extension to receive a speech request and | 141 there's no way for an extension to receive a speech request and |
155 dynamically decide whether to handle it.</p> | 142 dynamically decide whether to handle it.</p> |
OLD | NEW |