Index: chrome/common/extensions/docs/static/experimental.ttsEngine.html |
=================================================================== |
--- chrome/common/extensions/docs/static/experimental.ttsEngine.html (revision 92678) |
+++ chrome/common/extensions/docs/static/experimental.ttsEngine.html (working copy) |
@@ -2,7 +2,7 @@ |
Use the <code>chrome.experimental.ttsEngine</code> module to |
implement a text-to-speech (TTS) engine using an extension. If your |
extension registers using this API, it will receive events containing |
-the intended utterance and other parameters when any extension or packaged |
+an utterance to be spoken and other parameters when any extension or packaged |
app uses the |
<a href="experimental.tts.html">experimental.tts</a> |
module to generate speech. Your extension can then use any available |
@@ -64,8 +64,8 @@ |
<p>The <code>voice_name</code> parameter is required. The name should be |
descriptive enough that it identifies the name of the voice and the |
engine used. In the unlikely event that two extensions register voices |
-with the same name, a client can manually specify the extension id it |
-wants to do the synthesis.</p> |
+with the same name, a client can specify the ID of the extension that |
+should do the synthesis.</p> |
<p>The <code>gender</code> parameter is optional. If your voice corresponds |
to a male or female voice, you can use this parameter to help clients |
@@ -83,30 +83,34 @@ |
<p>Finally, the <code>event_types</code> parameter is required if the engine can |
send events to update the client on the progress of speech synthesis. |
At a minimum, supporting the <code>'end'</code> event type to indicate |
-when speech is finished is highly recommend, otherwise it's impossible |
-for Chrome to schedule queued utterances.</p> |
+when speech is finished is highly recommended, otherwise Chrome cannot |
+schedule queued utterances.</p> |
-<p class="note">If your TTS engine does not support the <code>'end'</code> |
-event type, Chrome will pass the <code>enqueue</code> option to |
-onSpeak, so that your engine can implement its own queuing. However, this is |
-discouraged because it means that users cannot queue utterances that get |
-sent to different speech engines.</p> |
+<p class="note"> |
+<strong>Note:</strong> If your TTS engine does not support |
+the <code>'end'</code> event type, Chrome cannot queue utterances |
+because it has no way of knowing when your utterance has finished. To |
+help mitigate this, Chrome passes an additional boolean <code>enqueue</code> |
+option to your engine's onSpeak handler, giving you the option of |
+implementing your own queueing. This is discouraged because then |
+clients are unable to queue utterances that should get spoken by different |
+speech engines.</p> |
-<p>The possible event types you can send correspond to the event types that |
-the <code>speak()</code> method receives:</p> |
+<p>The possible event types that you can send correspond to the event types |
+that the <code>speak()</code> method receives:</p> |
<ul> |
- <li><code>'start'</code>: the engine has started speaking the utterance. |
- <li><code>'word'</code>: a word boundary was reached. Use |
+ <li><code>'start'</code>: The engine has started speaking the utterance. |
+ <li><code>'word'</code>: A word boundary was reached. Use |
<code>event.charIndex</code> to determine the current speech |
position. |
- <li><code>'sentence'</code>: a sentence boundary was reached. Use |
+ <li><code>'sentence'</code>: A sentence boundary was reached. Use |
<code>event.charIndex</code> to determine the current speech |
position. |
- <li><code>'marker'</code>: an SSML marker was reached. Use |
+ <li><code>'marker'</code>: An SSML marker was reached. Use |
<code>event.charIndex</code> to determine the current speech |
position. |
- <li><code>'end'</code>: the engine has finished speaking the utterance. |
+ <li><code>'end'</code>: The engine has finished speaking the utterance. |
<li><code>'error'</code>: An engine-specific error occurred and |
this utterance cannot be spoken. |
Pass more information in <code>event.errorMessage</code>. |
@@ -115,11 +119,12 @@ |
<p>The <code>'interrupted'</code> and <code>'cancelled'</code> events are |
not sent by the speech engine; they are generated automatically by Chrome.</p> |
-<p>The information about your extensions's voices from your manifest |
-will be returned to any client that calls <code>getVoices</code>, assuming |
-you've also registered speech event listeners as described below.</p> |
+<p>Text-to-speech clients can get the voice information from your |
+extension's manifest by calling |
+<a href="experimental.tts.html#method-getVoices">getVoices()</a>, |
+assuming you've registered speech event listeners as described below.</p> |
-<h2 id="handling_speech_events">Handling Speech Events</h2> |
+<h2 id="handling_speech_events">Handling speech events</h2> |
<p>To generate speech at the request of clients, your extension must |
register listeners for both <code>onSpeak</code> and <code>onStop</code>, |
@@ -140,7 +145,9 @@ |
chrome.experimental.ttsEngine.onSpeak.addListener(speakListener); |
chrome.experimental.ttsEngine.onStop.addListener(stopListener);</pre> |
-<p class="warning">If an extension does not register listeners for both |
+<p class="warning"> |
+<b>Important:</b> |
+If your extension does not register listeners for both |
<code>onSpeak</code> and <code>onStop</code>, it will not intercept any |
speech calls, regardless of what is in the manifest.</p> |
@@ -149,4 +156,4 @@ |
parameters in its manifest and has registered listeners |
for <code>onSpeak</code> and <code>onStop</code>. In other words, |
there's no way for an extension to receive a speech request and |
-dynamically decide whether to handle it or not.</p> |
+dynamically decide whether to handle it.</p> |