| OLD | NEW |
| 1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: | 1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: |
| 2 1) The <head> information in this page is significant, should be uniform | 2 1) The <head> information in this page is significant, should be uniform |
| 3 across api docs and should be edited only with knowledge of the | 3 across api docs and should be edited only with knowledge of the |
| 4 templating mechanism. | 4 templating mechanism. |
| 5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | 5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a |
| 6 browser, it will be re-generated from the template, json schema and | 6 browser, it will be re-generated from the template, json schema and |
| 7 authored overview content. | 7 authored overview content. |
| 8 4) The <body>.innerHTML is also generated by an offline step so that this | 8 4) The <body>.innerHTML is also generated by an offline step so that this |
| 9 page may easily be indexed by search engines. | 9 page may easily be indexed by search engines. |
| 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> |
| 11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | 11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> | 12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> |
| 13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> | 13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> |
| 14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> | 14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> |
| 15 </script> | 15 </script> |
| 16 <script type="text/javascript" src="../../../../third_party/json_minify/mini
fy-sans-regexp.js"> | 16 <script type="text/javascript" src="../../../../third_party/json_minify/mini
fy-sans-regexp.js"> |
| 17 </script> | 17 </script> |
| 18 <script type="text/javascript" src="js/api_page_generator.js"></script> | 18 <script type="text/javascript" src="js/api_page_generator.js"></script> |
| 19 <script type="text/javascript" src="js/bootstrap.js"></script> | 19 <script type="text/javascript" src="js/bootstrap.js"></script> |
| 20 <script type="text/javascript" src="js/sidebar.js"></script> | 20 <script type="text/javascript" src="js/sidebar.js"></script> |
| 21 <meta name="description" content="Documentation for the chrome.ttsEngine modul
e, which is part of the Google Chrome extension APIs."><title>chrome.ttsEngine
- Google Chrome Extensions - Google Code</title></head> | 21 <meta name="description" content="Documentation for the chrome.experimental.do
wnloads module, which is part of the Google Chrome extension APIs."><title>chro
me.experimental.downloads - Google Chrome Extensions - Google Code</title></head
> |
| 22 <body> <div id="devModeWarning" class="displayModeWarning"> | 22 <body> <div id="devModeWarning" class="displayModeWarning"> |
| 23 You are viewing extension docs in chrome via the 'file:' scheme: are you exp
ecting to see local changes when you refresh? You'll need run chrome with --allo
w-file-access-from-files. | 23 You are viewing extension docs in chrome via the 'file:' scheme: are you exp
ecting to see local changes when you refresh? You'll need run chrome with --allo
w-file-access-from-files. |
| 24 </div> | 24 </div> |
| 25 <div id="branchWarning" class="displayModeWarning"> | 25 <div id="branchWarning" class="displayModeWarning"> |
| 26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. | 26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. |
| 27 It may not work with the stable release of Chrome.</span> | 27 It may not work with the stable release of Chrome.</span> |
| 28 <select id="branchChooser"> | 28 <select id="branchChooser"> |
| 29 <option>Choose a different version... | 29 <option>Choose a different version... |
| 30 </option><option value="">Stable | 30 </option><option value="">Stable |
| 31 </option><option value="beta">Beta | 31 </option><option value="beta">Beta |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 <li><a href="themes.html">Themes</a></li> | 178 <li><a href="themes.html">Themes</a></li> |
| 179 </ul> | 179 </ul> |
| 180 </li> | 180 </li> |
| 181 </ul> | 181 </ul> |
| 182 </div> | 182 </div> |
| 183 <script> | 183 <script> |
| 184 initToggles(); | 184 initToggles(); |
| 185 </script> | 185 </script> |
| 186 <div class="g-unit" id="gc-pagecontent"> | 186 <div class="g-unit" id="gc-pagecontent"> |
| 187 <div id="pageTitle"> | 187 <div id="pageTitle"> |
| 188 <h1 class="page_title">chrome.ttsEngine</h1> | 188 <h1 class="page_title">chrome.experimental.downloads</h1> |
| 189 </div> | 189 </div> |
| 190 <!-- TABLE OF CONTENTS --> | 190 <!-- TABLE OF CONTENTS --> |
| 191 <div id="toc"> | 191 <div id="toc"> |
| 192 <h2>Contents</h2> | 192 <h2>Contents</h2> |
| 193 <ol> | 193 <ol> |
| 194 <li> | 194 <li> |
| 195 <a href="#overview">Overview</a> | |
| 196 <ol> | |
| 197 </ol> | |
| 198 </li><li> | |
| 199 <a href="#manifest">Manifest</a> | 195 <a href="#manifest">Manifest</a> |
| 200 <ol> | 196 <ol> |
| 201 </ol> | 197 </ol> |
| 202 </li><li> | 198 </li><li> |
| 203 <a href="#handling_speech_events">Handling speech events</a> | 199 <a href="#examples"> Examples </a> |
| 204 <ol> | 200 <ol> |
| 205 </ol> | 201 </ol> |
| 206 </li> | 202 </li> |
| 207 <li> | 203 <li> |
| 208 <a href="#apiReference">API reference: chrome.ttsEngine</a> | 204 <a href="#apiReference">API reference: chrome.experimental.downl
oads</a> |
| 209 <ol> | 205 <ol> |
| 210 <li> | 206 <li> |
| 207 <a href="#properties">Properties</a> |
| 208 <ol> |
| 209 <li> |
| 210 <a href="#property-ERROR_GENERIC">ERROR_GENERIC</a> |
| 211 </li><li> |
| 212 <a href="#property-ERROR_INVALID_URL">ERROR_INVALID_URL</a> |
| 213 </li> |
| 214 </ol> |
| 215 </li> |
| 216 <li> |
| 211 <a href="#global-methods">Methods</a> | 217 <a href="#global-methods">Methods</a> |
| 212 <ol> | 218 <ol> |
| 219 <li> |
| 220 <a href="#method-download">download</a> |
| 221 </li> |
| 213 </ol> | 222 </ol> |
| 214 </li> | 223 </li> |
| 215 <li> | 224 <li> |
| 216 <a href="#global-events">Events</a> | 225 <a href="#types">Types</a> |
| 217 <ol> | 226 <ol> |
| 218 <li> | 227 <li> |
| 219 <a href="#event-onSpeak">onSpeak</a> | 228 <a href="#type-HttpHeaders">HttpHeaders</a> |
| 220 </li><li> | 229 <ol> |
| 221 <a href="#event-onStop">onStop</a> | 230 </ol> |
| 222 </li> | 231 </li> |
| 223 </ol> | 232 </ol> |
| 224 </li> | 233 </li> |
| 225 </ol> | 234 </ol> |
| 226 </li> | 235 </li> |
| 227 </ol> | 236 </ol> |
| 228 </div> | 237 </div> |
| 229 <!-- /TABLE OF CONTENTS --> | 238 <!-- /TABLE OF CONTENTS --> |
| 230 <!-- Standard content lead-in for experimental API pages --> | 239 <!-- Standard content lead-in for experimental API pages --> |
| 240 <p id="classSummary"> |
| 241 For information on how to use experimental APIs, see the <a href="expe
rimental.html">chrome.experimental.* APIs</a> page. |
| 242 </p> |
| 231 <!-- STATIC CONTENT PLACEHOLDER --> | 243 <!-- STATIC CONTENT PLACEHOLDER --> |
| 232 <div id="static"><p id="classSummary"> | 244 <div id="static"><p>The downloads API allows you to programmatically ini
tiate downloads. In the |
| 233 Use the <code>chrome.ttsEngine</code> module to | 245 future, you will also be able to monitor and manipulate downloads.</p> |
| 234 implement a text-to-speech (TTS) engine using an extension. If your | |
| 235 extension registers using this API, it will receive events containing | |
| 236 an utterance to be spoken and other parameters when any extension or packaged | |
| 237 app uses the | |
| 238 <a href="tts.html">tts</a> | |
| 239 module to generate speech. Your extension can then use any available | |
| 240 web technology to synthesize and output the speech, and send events back | |
| 241 to the calling function to report the status. | |
| 242 </p> | |
| 243 <h2 id="overview">Overview</h2> | |
| 244 <p>An extension can register itself as a speech engine. By doing so, it | |
| 245 can intercept some or all calls to functions such as | |
| 246 <a href="tts.html#method-speak"><code>speak()</code></a> and | |
| 247 <a href="tts.html#method-stop"><code>stop()</code></a> | |
| 248 and provide an alternate implementation. | |
| 249 Extensions are free to use any available web technology | |
| 250 to provide speech, including streaming audio from a server, HTML5 audio, | |
| 251 Native Client, or Flash. An extension could even do something different | |
| 252 with the utterances, like display closed captions in a pop-up window or | |
| 253 send them as log messages to a remote server.</p> | |
| 254 <h2 id="manifest">Manifest</h2> | 246 <h2 id="manifest">Manifest</h2> |
| 255 <p>To implement a TTS engine, an extension must | 247 <p>The downloads API is currently experimental, so you must declare the |
| 256 declare the "ttsEngine" permission and then declare all voices | 248 "experimental" permission to use it. Also, you must specify the hostname of any |
| 257 it provides in the extension manifest, like this:</p> | 249 URLs to be downloaded. For example:</p> |
| 258 <pre>{ | 250 <pre>{ |
| 259 "name": "My TTS Engine", | 251 "name": "Download Selected Links", |
| 260 "version": "1.0", | 252 "description": "Select links on a page and download them.", |
| 261 <b>"permissions": ["ttsEngine"], | 253 "version": "0.1", |
| 262 "tts_engine": { | 254 "permissions": [ |
| 263 "voices": [ | 255 "experimental", "http://*/*", "https://*/*" |
| 264 { | 256 ]}</pre> |
| 265 "voice_name": "Alice", | 257 <p>If the URL’s hostname is not specified in the permissions, then the |
| 266 "lang": "en-US", | 258 chrome.extensions.lastError object will indicate that the extension does not |
| 267 "gender": "female", | 259 have permission to access that hostname. |
| 268 "event_types": ["start", "marker", "end"] | 260 <a href="#properties">downloads.ERROR_*</a> are some of the errors that may be |
| 269 }, | 261 returned.</p> |
| 270 { | 262 <h2 id="examples"> Examples </h2> |
| 271 "voice_name": "Pat", | 263 <p>You can find simple examples of using the downloads module in the |
| 272 "lang": "en-US", | 264 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension
s/docs/examples/api/downloads/">examples/api/downloads</a> |
| 273 "event_types": ["end"] | 265 directory. For other examples and for help in viewing the source code, see |
| 274 } | 266 <a href="samples.html">Samples</a>.</p> |
| 275 ] | |
| 276 },</b> | |
| 277 "background_page": "background.html", | |
| 278 }</pre> | |
| 279 <p>An extension can specify any number of voices.</p> | |
| 280 <p>The <code>voice_name</code> parameter is required. The name should be | |
| 281 descriptive enough that it identifies the name of the voice and the | |
| 282 engine used. In the unlikely event that two extensions register voices | |
| 283 with the same name, a client can specify the ID of the extension that | |
| 284 should do the synthesis.</p> | |
| 285 <p>The <code>gender</code> parameter is optional. If your voice corresponds | |
| 286 to a male or female voice, you can use this parameter to help clients | |
| 287 choose the most appropriate voice for their application.</p> | |
| 288 <p>The <code>lang</code> parameter is optional, but highly recommended. | |
| 289 Almost always, a voice can synthesize speech in just a single language. | |
| 290 When an engine supports more than one language, it can easily register a | |
| 291 separate voice for each language. Under rare circumstances where a single | |
| 292 voice can handle more than one language, it's easiest to just list two | |
| 293 separate voices and handle them using the same logic internally. However, | |
| 294 if you want to create a voice that will handle utterances in any language, | |
| 295 leave out the <code>lang</code> parameter from your extension's manifest.</p> | |
| 296 <p>Finally, the <code>event_types</code> parameter is required if the engine can | |
| 297 send events to update the client on the progress of speech synthesis. | |
| 298 At a minimum, supporting the <code>'end'</code> event type to indicate | |
| 299 when speech is finished is highly recommended, otherwise Chrome cannot | |
| 300 schedule queued utterances.</p> | |
| 301 <p class="note"> | |
| 302 <strong>Note:</strong> If your TTS engine does not support | |
| 303 the <code>'end'</code> event type, Chrome cannot queue utterances | |
| 304 because it has no way of knowing when your utterance has finished. To | |
| 305 help mitigate this, Chrome passes an additional boolean <code>enqueue</code> | |
| 306 option to your engine's onSpeak handler, giving you the option of | |
| 307 implementing your own queueing. This is discouraged because then | |
| 308 clients are unable to queue utterances that should get spoken by different | |
| 309 speech engines.</p> | |
| 310 <p>The possible event types that you can send correspond to the event types | |
| 311 that the <code>speak()</code> method receives:</p> | |
| 312 <ul> | |
| 313 <li><code>'start'</code>: The engine has started speaking the utterance. | |
| 314 </li><li><code>'word'</code>: A word boundary was reached. Use | |
| 315 <code>event.charIndex</code> to determine the current speech | |
| 316 position. | |
| 317 </li><li><code>'sentence'</code>: A sentence boundary was reached. Use | |
| 318 <code>event.charIndex</code> to determine the current speech | |
| 319 position. | |
| 320 </li><li><code>'marker'</code>: An SSML marker was reached. Use | |
| 321 <code>event.charIndex</code> to determine the current speech | |
| 322 position. | |
| 323 </li><li><code>'end'</code>: The engine has finished speaking the utterance. | |
| 324 </li><li><code>'error'</code>: An engine-specific error occurred and | |
| 325 this utterance cannot be spoken. | |
| 326 Pass more information in <code>event.errorMessage</code>. | |
| 327 </li></ul> | |
| 328 <p>The <code>'interrupted'</code> and <code>'cancelled'</code> events are | |
| 329 not sent by the speech engine; they are generated automatically by Chrome.</p> | |
| 330 <p>Text-to-speech clients can get the voice information from your | |
| 331 extension's manifest by calling | |
| 332 <a href="tts.html#method-getVoices">getVoices()</a>, | |
| 333 assuming you've registered speech event listeners as described below.</p> | |
| 334 <h2 id="handling_speech_events">Handling speech events</h2> | |
| 335 <p>To generate speech at the request of clients, your extension must | |
| 336 register listeners for both <code>onSpeak</code> and <code>onStop</code>, | |
| 337 like this:</p> | |
| 338 <pre>var speakListener = function(utterance, options, sendTtsEvent) { | |
| 339 sendTtsEvent({'event_type': 'start', 'charIndex': 0}) | |
| 340 // (start speaking) | |
| 341 sendTtsEvent({'event_type': 'end', 'charIndex': utterance.length}) | |
| 342 }; | |
| 343 var stopListener = function() { | |
| 344 // (stop all speech) | |
| 345 }; | |
| 346 chrome.ttsEngine.onSpeak.addListener(speakListener); | |
| 347 chrome.ttsEngine.onStop.addListener(stopListener);</pre> | |
| 348 <p class="warning"> | |
| 349 <b>Important:</b> | |
| 350 If your extension does not register listeners for both | |
| 351 <code>onSpeak</code> and <code>onStop</code>, it will not intercept any | |
| 352 speech calls, regardless of what is in the manifest.</p> | |
| 353 <p>The decision of whether or not to send a given speech request to an | |
| 354 extension is based solely on whether the extension supports the given voice | |
| 355 parameters in its manifest and has registered listeners | |
| 356 for <code>onSpeak</code> and <code>onStop</code>. In other words, | |
| 357 there's no way for an extension to receive a speech request and | |
| 358 dynamically decide whether to handle it.</p> | |
| 359 </div> | 267 </div> |
| 360 <!-- API PAGE --> | 268 <!-- API PAGE --> |
| 361 <div class="apiPage"> | 269 <div class="apiPage"> |
| 362 <a name="apiReference"></a> | 270 <a name="apiReference"></a> |
| 363 <h2>API reference: chrome.ttsEngine</h2> | 271 <h2>API reference: chrome.experimental.downloads</h2> |
| 364 <!-- PROPERTIES --> | 272 <!-- PROPERTIES --> |
| 365 <!-- /apiGroup --> | 273 <div class="apiGroup"> |
| 274 <a name="properties"></a> |
| 275 <h3 id="properties">Properties</h3> |
| 276 <div> |
| 277 <a name="property-ERROR_GENERIC"></a> |
| 278 <h4>ERROR_GENERIC</h4> |
| 279 <div class="summary"> |
| 280 <!-- Note: intentionally longer 80 columns --> |
| 281 <span>chrome.experimental.downloads.</span><span>ERROR_GENERIC</
span> |
| 282 </div> |
| 283 <div> |
| 284 <dt> |
| 285 <var>ERROR_GENERIC</var> |
| 286 <em> |
| 287 <!-- TYPE --> |
| 288 <div style="display:inline"> |
| 289 ( |
| 290 <span id="typeTemplate"> |
| 291 <code>"I'm afraid I can't do that."</code> |
| 292 </span> |
| 293 ) |
| 294 </div> |
| 295 </em> |
| 296 </dt> |
| 297 <dd>Generic error.</dd> |
| 298 <!-- OBJECT PROPERTIES --> |
| 299 <!-- OBJECT METHODS --> |
| 300 <!-- OBJECT EVENT FIELDS --> |
| 301 <!-- FUNCTION PARAMETERS --> |
| 302 </div> |
| 303 </div><div> |
| 304 <a name="property-ERROR_INVALID_URL"></a> |
| 305 <h4>ERROR_INVALID_URL</h4> |
| 306 <div class="summary"> |
| 307 <!-- Note: intentionally longer 80 columns --> |
| 308 <span>chrome.experimental.downloads.</span><span>ERROR_INVALID_U
RL</span> |
| 309 </div> |
| 310 <div> |
| 311 <dt> |
| 312 <var>ERROR_INVALID_URL</var> |
| 313 <em> |
| 314 <!-- TYPE --> |
| 315 <div style="display:inline"> |
| 316 ( |
| 317 <span id="typeTemplate"> |
| 318 <code>"Invalid URL."</code> |
| 319 </span> |
| 320 ) |
| 321 </div> |
| 322 </em> |
| 323 </dt> |
| 324 <dd>The URL was invalid.</dd> |
| 325 <!-- OBJECT PROPERTIES --> |
| 326 <!-- OBJECT METHODS --> |
| 327 <!-- OBJECT EVENT FIELDS --> |
| 328 <!-- FUNCTION PARAMETERS --> |
| 329 </div> |
| 330 </div> |
| 331 </div> <!-- /apiGroup --> |
| 366 <!-- METHODS --> | 332 <!-- METHODS --> |
| 367 <div id="methodsTemplate" class="apiGroup"> | 333 <div id="methodsTemplate" class="apiGroup"> |
| 368 <a name="global-methods"></a> | 334 <a name="global-methods"></a> |
| 369 <h3>Methods</h3> | 335 <h3>Methods</h3> |
| 370 <!-- iterates over all functions --> | 336 <!-- iterates over all functions --> |
| 371 <!-- /apiItem --> | |
| 372 </div> <!-- /apiGroup --> | |
| 373 <!-- EVENTS --> | |
| 374 <div id="eventsTemplate" class="apiGroup"> | |
| 375 <a name="global-events"></a> | |
| 376 <h3>Events</h3> | |
| 377 <!-- iterates over all events --> | |
| 378 <div class="apiItem"> | 337 <div class="apiItem"> |
| 379 <a name="event-onSpeak"></a> | 338 <a name="method-download"></a> <!-- method-anchor --> |
| 380 <h4>onSpeak</h4> | 339 <h4>download</h4> |
| 381 <div class="summary"> | 340 <div class="summary"> |
| 382 <!-- Note: intentionally longer 80 columns --> | 341 <!-- Note: intentionally longer 80 columns --> |
| 383 <span class="subdued">chrome.ttsEngine.</span><span>onSpeak</spa
n><span class="subdued">.addListener</span>(function(<span>string utterance, obj
ect options, function sendTtsEvent</span>) <span class="subdued">{...}</span><sp
an></span>); | 342 <span>chrome.experimental.downloads.download</span>(<span clas
s="null"><span>object</span> |
| 384 </div> | 343 <var><span>options</span></var></span><span class="optiona
l"><span>, </span><span>function</span> |
| 344 <var><span>callback</span></var></span>)</div> |
| 385 <div class="description"> | 345 <div class="description"> |
| 386 <p>Called when the user makes a call to tts.speak() and one of t
he voices from this extension's manifest is the first to match the options objec
t.</p> | 346 <p>Download a URL. If the URL uses the HTTP[S] protocol, then th
e request will include all cookies currently set for its hostname. If the downlo
ad started successfully, <code>callback</code> will be called with the new Downl
oadItem’s <code>downloadId</code>. If there was an error starting the download,
then <code>callback</code> will be called with <code>downloadId=undefined</code>
and <code>chrome.extension.lastError</code> will be set. If both <code>filename
</code> and <code>saveAs</code> are specified, then the Save As dialog will be d
isplayed, pre-populated with the specified <code>filename</code>.</p> |
| 387 <!-- LISTENER PARAMETERS --> | 347 <!-- PARAMETERS --> |
| 388 <div> | 348 <h4>Parameters</h4> |
| 389 <h4>Listener parameters</h4> | 349 <dl> |
| 390 <dl> | 350 <div> |
| 391 <div> | 351 <div> |
| 392 <div> | |
| 393 <dt> | |
| 394 <var>utterance</var> | |
| 395 <em> | |
| 396 <!-- TYPE --> | |
| 397 <div style="display:inline"> | |
| 398 ( | |
| 399 <span id="typeTemplate"> | |
| 400 <span> | |
| 401 <span>string</span> | |
| 402 </span> | |
| 403 </span> | |
| 404 ) | |
| 405 </div> | |
| 406 </em> | |
| 407 </dt> | |
| 408 <dd>The text to speak, specified as either plain text or an SSML docum
ent. If your engine does not support SSML, you should strip out all XML markup a
nd synthesize only the underlying text content. The value of this parameter is g
uaranteed to be no more than 32,768 characters. If this engine does not support
speaking that many characters at a time, the utterance should be split into smal
ler chunks and queued internally without returning an error.</dd> | |
| 409 <!-- OBJECT PROPERTIES --> | |
| 410 <!-- OBJECT METHODS --> | |
| 411 <!-- OBJECT EVENT FIELDS --> | |
| 412 <!-- FUNCTION PARAMETERS --> | |
| 413 </div> | |
| 414 </div><div> | |
| 415 <div> | |
| 416 <dt> | 352 <dt> |
| 417 <var>options</var> | 353 <var>options</var> |
| 418 <em> | 354 <em> |
| 419 <!-- TYPE --> | 355 <!-- TYPE --> |
| 420 <div style="display:inline"> | 356 <div style="display:inline"> |
| 421 ( | 357 ( |
| 422 <span id="typeTemplate"> | 358 <span id="typeTemplate"> |
| 423 <span> | 359 <span> |
| 424 <span>object</span> | 360 <span>object</span> |
| 425 </span> | 361 </span> |
| 426 </span> | 362 </span> |
| 427 ) | 363 ) |
| 428 </div> | 364 </div> |
| 429 </em> | 365 </em> |
| 430 </dt> | 366 </dt> |
| 431 <dd>Options specified to the tts.speak() method.</dd> | 367 <dd class="todo"> |
| 368 Undocumented. |
| 369 </dd> |
| 432 <!-- OBJECT PROPERTIES --> | 370 <!-- OBJECT PROPERTIES --> |
| 433 <dd> | 371 <dd> |
| 434 <dl> | 372 <dl> |
| 435 <div> | 373 <div> |
| 436 <div> | 374 <div> |
| 437 <dt> | 375 <dt> |
| 438 <var>voiceName</var> | 376 <var>url</var> |
| 439 <em> | 377 <em> |
| 440 <!-- TYPE --> | 378 <!-- TYPE --> |
| 441 <div style="display:inline"> | 379 <div style="display:inline"> |
| 442 ( | 380 ( |
| 443 <span class="optional">optional</span> | |
| 444 <span id="typeTemplate"> | 381 <span id="typeTemplate"> |
| 445 <span> | 382 <span> |
| 446 <span>string</span> | 383 <span>string</span> |
| 447 </span> | 384 </span> |
| 448 </span> | 385 </span> |
| 449 ) | 386 ) |
| 450 </div> | 387 </div> |
| 451 </em> | 388 </em> |
| 452 </dt> | 389 </dt> |
| 453 <dd>The name of the voice to use for synthesis.</dd> | 390 <dd>The URL to download.</dd> |
| 454 <!-- OBJECT PROPERTIES --> | 391 <!-- OBJECT PROPERTIES --> |
| 455 <!-- OBJECT METHODS --> | 392 <!-- OBJECT METHODS --> |
| 456 <!-- OBJECT EVENT FIELDS --> | 393 <!-- OBJECT EVENT FIELDS --> |
| 457 <!-- FUNCTION PARAMETERS --> | 394 <!-- FUNCTION PARAMETERS --> |
| 458 </div> | 395 </div> |
| 459 </div><div> | 396 </div><div> |
| 460 <div> | 397 <div> |
| 461 <dt> | 398 <dt> |
| 462 <var>lang</var> | 399 <var>filename</var> |
| 463 <em> | 400 <em> |
| 464 <!-- TYPE --> | 401 <!-- TYPE --> |
| 465 <div style="display:inline"> | 402 <div style="display:inline"> |
| 466 ( | 403 ( |
| 467 <span class="optional">optional</span> | 404 <span class="optional">optional</span> |
| 468 <span id="typeTemplate"> | 405 <span id="typeTemplate"> |
| 469 <span> | 406 <span> |
| 470 <span>string</span> | 407 <span>string</span> |
| 471 </span> | 408 </span> |
| 472 </span> | 409 </span> |
| 473 ) | 410 ) |
| 474 </div> | 411 </div> |
| 475 </em> | 412 </em> |
| 476 </dt> | 413 </dt> |
| 477 <dd>The language to be used for synthesis, in the form <em>language</e
m>-<em>region</em>. Examples: 'en', 'en-US', 'en-GB', 'zh-CN'.</dd> | 414 <dd>A file path relative to the Downloads directory to contain the dow
nloaded file.</dd> |
| 478 <!-- OBJECT PROPERTIES --> | 415 <!-- OBJECT PROPERTIES --> |
| 479 <!-- OBJECT METHODS --> | 416 <!-- OBJECT METHODS --> |
| 480 <!-- OBJECT EVENT FIELDS --> | 417 <!-- OBJECT EVENT FIELDS --> |
| 481 <!-- FUNCTION PARAMETERS --> | 418 <!-- FUNCTION PARAMETERS --> |
| 482 </div> | 419 </div> |
| 483 </div><div> | 420 </div><div> |
| 484 <div> | 421 <div> |
| 485 <dt> | 422 <dt> |
| 486 <var>gender</var> | 423 <var>saveAs</var> |
| 487 <em> | 424 <em> |
| 488 <!-- TYPE --> | 425 <!-- TYPE --> |
| 489 <div style="display:inline"> | 426 <div style="display:inline"> |
| 490 ( | 427 ( |
| 491 <span class="optional">optional</span> | 428 <span class="optional">optional</span> |
| 492 <span class="enum">enumerated</span> | |
| 493 <span id="typeTemplate"> | 429 <span id="typeTemplate"> |
| 494 <span> | 430 <span> |
| 495 <span>string</span> | 431 <span>boolean</span> |
| 496 <span>["male", "female"]</span> | |
| 497 </span> | 432 </span> |
| 498 </span> | 433 </span> |
| 499 ) | 434 ) |
| 500 </div> | 435 </div> |
| 501 </em> | 436 </em> |
| 502 </dt> | 437 </dt> |
| 503 <dd>Gender of voice for synthesized speech.</dd> | 438 <dd>Use a file-chooser to allow the user to select a filename.</dd> |
| 504 <!-- OBJECT PROPERTIES --> | 439 <!-- OBJECT PROPERTIES --> |
| 505 <!-- OBJECT METHODS --> | 440 <!-- OBJECT METHODS --> |
| 506 <!-- OBJECT EVENT FIELDS --> | 441 <!-- OBJECT EVENT FIELDS --> |
| 507 <!-- FUNCTION PARAMETERS --> | 442 <!-- FUNCTION PARAMETERS --> |
| 508 </div> | 443 </div> |
| 509 </div><div> | 444 </div><div> |
| 510 <div> | 445 <div> |
| 511 <dt> | 446 <dt> |
| 512 <var>rate</var> | 447 <var>method</var> |
| 513 <em> | 448 <em> |
| 514 <!-- TYPE --> | 449 <!-- TYPE --> |
| 515 <div style="display:inline"> | 450 <div style="display:inline"> |
| 516 ( | 451 ( |
| 517 <span class="optional">optional</span> | 452 <span class="optional">optional</span> |
| 453 <span class="enum">enumerated</span> |
| 518 <span id="typeTemplate"> | 454 <span id="typeTemplate"> |
| 519 <span> | 455 <span> |
| 520 <span>number</span> | 456 <span>string</span> |
| 457 <span>["GET", "POST"]</span> |
| 521 </span> | 458 </span> |
| 522 </span> | 459 </span> |
| 523 ) | 460 ) |
| 524 </div> | 461 </div> |
| 525 </em> | 462 </em> |
| 526 </dt> | 463 </dt> |
| 527 <dd>Speaking rate relative to the default rate for this voice. 1.0 is
the default rate, normally around 180 to 220 words per minute. 2.0 is twice as f
ast, and 0.5 is half as fast. This value is guaranteed to be between 0.1 and 10.
0, inclusive. When a voice does not support this full range of rates, don't retu
rn an error. Instead, clip the rate to the range the voice supports.</dd> | 464 <dd>The HTTP method to use if the URL uses the HTTP[S] protocol.</dd> |
| 528 <!-- OBJECT PROPERTIES --> | 465 <!-- OBJECT PROPERTIES --> |
| 529 <!-- OBJECT METHODS --> | 466 <!-- OBJECT METHODS --> |
| 530 <!-- OBJECT EVENT FIELDS --> | 467 <!-- OBJECT EVENT FIELDS --> |
| 531 <!-- FUNCTION PARAMETERS --> | 468 <!-- FUNCTION PARAMETERS --> |
| 532 </div> | 469 </div> |
| 533 </div><div> | 470 </div><div> |
| 534 <div> | 471 <div> |
| 535 <dt> | 472 <dt> |
| 536 <var>pitch</var> | 473 <var>headers</var> |
| 537 <em> | 474 <em> |
| 538 <!-- TYPE --> | 475 <!-- TYPE --> |
| 539 <div style="display:inline"> | 476 <div style="display:inline"> |
| 540 ( | 477 ( |
| 541 <span class="optional">optional</span> | 478 <span class="optional">optional</span> |
| 542 <span id="typeTemplate"> | 479 <span id="typeTemplate"> |
| 543 <span> | 480 <span> |
| 544 <span>number</span> | 481 <a href="webRequest.html#type-HttpHeaders">HttpHeaders</
a> |
| 545 </span> | 482 </span> |
| 546 </span> | 483 </span> |
| 547 ) | 484 ) |
| 548 </div> | 485 </div> |
| 549 </em> | 486 </em> |
| 550 </dt> | 487 </dt> |
| 551 <dd>Speaking pitch between 0 and 2 inclusive, with 0 being lowest and
2 being highest. 1.0 corresponds to this voice's default pitch.</dd> | 488 <dd>Extra HTTP headers to send with the request if the URL uses the HT
TP[s] protocol, restricted to those allowed by XMLHttpRequest.</dd> |
| 552 <!-- OBJECT PROPERTIES --> | 489 <!-- OBJECT PROPERTIES --> |
| 553 <!-- OBJECT METHODS --> | 490 <!-- OBJECT METHODS --> |
| 554 <!-- OBJECT EVENT FIELDS --> | 491 <!-- OBJECT EVENT FIELDS --> |
| 555 <!-- FUNCTION PARAMETERS --> | 492 <!-- FUNCTION PARAMETERS --> |
| 556 </div> | 493 </div> |
| 557 </div><div> | 494 </div><div> |
| 558 <div> | 495 <div> |
| 559 <dt> | 496 <dt> |
| 560 <var>volume</var> | 497 <var>body</var> |
| 561 <em> | 498 <em> |
| 562 <!-- TYPE --> | 499 <!-- TYPE --> |
| 563 <div style="display:inline"> | 500 <div style="display:inline"> |
| 564 ( | 501 ( |
| 565 <span class="optional">optional</span> | 502 <span class="optional">optional</span> |
| 566 <span id="typeTemplate"> | 503 <span id="typeTemplate"> |
| 567 <span> | 504 <span> |
| 568 <span>number</span> | 505 <span>string</span> |
| 569 </span> | 506 </span> |
| 570 </span> | 507 </span> |
| 571 ) | 508 ) |
| 572 </div> | 509 </div> |
| 573 </em> | 510 </em> |
| 574 </dt> | 511 </dt> |
| 575 <dd>Speaking volume between 0 and 1 inclusive, with 0 being lowest and
1 being highest, with a default of 1.0.</dd> | 512 <dd>post body</dd> |
| 576 <!-- OBJECT PROPERTIES --> | 513 <!-- OBJECT PROPERTIES --> |
| 577 <!-- OBJECT METHODS --> | 514 <!-- OBJECT METHODS --> |
| 578 <!-- OBJECT EVENT FIELDS --> | 515 <!-- OBJECT EVENT FIELDS --> |
| 579 <!-- FUNCTION PARAMETERS --> | 516 <!-- FUNCTION PARAMETERS --> |
| 580 </div> | 517 </div> |
| 581 </div> | 518 </div> |
| 582 </dl> | 519 </dl> |
| 583 </dd> | 520 </dd> |
| 584 <!-- OBJECT METHODS --> | 521 <!-- OBJECT METHODS --> |
| 585 <!-- OBJECT EVENT FIELDS --> | 522 <!-- OBJECT EVENT FIELDS --> |
| 586 <!-- FUNCTION PARAMETERS --> | 523 <!-- FUNCTION PARAMETERS --> |
| 587 </div> | 524 </div> |
| 588 </div><div> | 525 </div><div> |
| 589 <div> | 526 <div> |
| 590 <dt> | 527 <dt> |
| 591 <var>sendTtsEvent</var> | 528 <var>callback</var> |
| 592 <em> | 529 <em> |
| 593 <!-- TYPE --> | 530 <!-- TYPE --> |
| 594 <div style="display:inline"> | 531 <div style="display:inline"> |
| 595 ( | 532 ( |
| 533 <span class="optional">optional</span> |
| 596 <span id="typeTemplate"> | 534 <span id="typeTemplate"> |
| 597 <span> | 535 <span> |
| 598 <span>function</span> | 536 <span>function</span> |
| 599 </span> | 537 </span> |
| 600 </span> | 538 </span> |
| 601 ) | 539 ) |
| 602 </div> | 540 </div> |
| 603 </em> | 541 </em> |
| 604 </dt> | 542 </dt> |
| 605 <dd>Call this function with events that occur in the process of speaki
ng the utterance.</dd> | 543 <dd class="todo"> |
| 544 Undocumented. |
| 545 </dd> |
| 606 <!-- OBJECT PROPERTIES --> | 546 <!-- OBJECT PROPERTIES --> |
| 607 <!-- OBJECT METHODS --> | 547 <!-- OBJECT METHODS --> |
| 608 <!-- OBJECT EVENT FIELDS --> | 548 <!-- OBJECT EVENT FIELDS --> |
| 609 <!-- FUNCTION PARAMETERS --> | 549 <!-- FUNCTION PARAMETERS --> |
| 610 <dd> | 550 </div> |
| 611 <div> | 551 </div> |
| 612 <h5>Parameters</h5> | 552 </dl> |
| 613 <dl> | 553 <!-- RETURNS --> |
| 614 <div> | 554 <dl> |
| 615 <div> | 555 </dl> |
| 556 <!-- CALLBACK --> |
| 557 <div> |
| 558 <div> |
| 559 <h4>Callback function</h4> |
| 560 <p> |
| 561 If you specify the <em>callback</em> parameter, it should |
| 562 specify a function that looks like this: |
| 563 </p> |
| 564 <!-- Note: intentionally longer 80 columns --> |
| 565 <pre>function(<span>integer downloadId</span>) <span class="su
bdued">{...}</span>;</pre> |
| 566 <dl> |
| 567 <div> |
| 568 <div> |
| 616 <dt> | 569 <dt> |
| 617 <var>event</var> | 570 <var>downloadId</var> |
| 618 <em> | 571 <em> |
| 619 <!-- TYPE --> | 572 <!-- TYPE --> |
| 620 <div style="display:inline"> | 573 <div style="display:inline"> |
| 621 ( | 574 ( |
| 622 <span id="typeTemplate"> | 575 <span id="typeTemplate"> |
| 623 <span> | 576 <span> |
| 624 <a href="tts.html#type-TtsEvent">TtsEvent</a> | 577 <span>integer</span> |
| 625 </span> | 578 </span> |
| 626 </span> | 579 </span> |
| 627 ) | 580 ) |
| 628 </div> | 581 </div> |
| 629 </em> | 582 </em> |
| 630 </dt> | 583 </dt> |
| 631 <dd>The event from the text-to-speech engine indicating the status of
this utterance.</dd> | 584 <dd>If not null, the identifier of the resulting Download Item.</dd> |
| 632 <!-- OBJECT PROPERTIES --> | 585 <!-- OBJECT PROPERTIES --> |
| 633 <!-- OBJECT METHODS --> | 586 <!-- OBJECT METHODS --> |
| 634 <!-- OBJECT EVENT FIELDS --> | 587 <!-- OBJECT EVENT FIELDS --> |
| 635 <!-- FUNCTION PARAMETERS --> | 588 <!-- FUNCTION PARAMETERS --> |
| 636 </div> | 589 </div> |
| 637 </div> | |
| 638 </dl> | |
| 639 </div> | |
| 640 </dd> | |
| 641 </div> | |
| 642 </div> | 590 </div> |
| 643 </dl> | 591 </dl> |
| 592 </div> |
| 644 </div> | 593 </div> |
| 645 <!-- EXTRA PARAMETERS --> | 594 <!-- MIN_VERSION --> |
| 646 <!-- LISTENER RETURN VALUE --> | |
| 647 <dl> | |
| 648 </dl> | |
| 649 </div> <!-- /description --> | 595 </div> <!-- /description --> |
| 650 </div><div class="apiItem"> | 596 </div> <!-- /apiItem --> |
| 651 <a name="event-onStop"></a> | 597 </div> <!-- /apiGroup --> |
| 652 <h4>onStop</h4> | 598 <!-- EVENTS --> |
| 653 <div class="summary"> | 599 <!-- /apiGroup --> |
| 654 <!-- Note: intentionally longer 80 columns --> | 600 <!-- TYPES --> |
| 655 <span class="subdued">chrome.ttsEngine.</span><span>onStop</span
><span class="subdued">.addListener</span>(function(<span></span>) <span class="
subdued">{...}</span><span></span>); | 601 <div class="apiGroup"> |
| 602 <a name="types"></a> |
| 603 <h3 id="types">Types</h3> |
| 604 <!-- iterates over all types --> |
| 605 <div class="apiItem"> |
| 606 <a name="type-HttpHeaders"></a> |
| 607 <h4>HttpHeaders</h4> |
| 608 <div> |
| 609 <dt> |
| 610 <em> |
| 611 <!-- TYPE --> |
| 612 <div style="display:inline"> |
| 613 ( |
| 614 <span id="typeTemplate"> |
| 615 <span> |
| 616 <span> |
| 617 array of <span><span> |
| 618 <span> |
| 619 <span>object</span> |
| 620 </span> |
| 621 </span></span> |
| 622 </span> |
| 623 </span> |
| 624 </span> |
| 625 ) |
| 626 </div> |
| 627 </em> |
| 628 </dt> |
| 629 <dd>An array of HTTP headers. Each header is represented as a dictiona
ry containing the keys <code>name</code> and either <code>value</code> or <code>
binaryValue</code>.</dd> |
| 630 <!-- OBJECT PROPERTIES --> |
| 631 <dd> |
| 632 <dl> |
| 633 <div> |
| 634 <div> |
| 635 <dt> |
| 636 <var>name</var> |
| 637 <em> |
| 638 <!-- TYPE --> |
| 639 <div style="display:inline"> |
| 640 ( |
| 641 <span id="typeTemplate"> |
| 642 <span> |
| 643 <span>string</span> |
| 644 </span> |
| 645 </span> |
| 646 ) |
| 647 </div> |
| 648 </em> |
| 649 </dt> |
| 650 <dd>Name of the HTTP header.</dd> |
| 651 <!-- OBJECT PROPERTIES --> |
| 652 <!-- OBJECT METHODS --> |
| 653 <!-- OBJECT EVENT FIELDS --> |
| 654 <!-- FUNCTION PARAMETERS --> |
| 655 </div> |
| 656 </div><div> |
| 657 <div> |
| 658 <dt> |
| 659 <var>value</var> |
| 660 <em> |
| 661 <!-- TYPE --> |
| 662 <div style="display:inline"> |
| 663 ( |
| 664 <span class="optional">optional</span> |
| 665 <span id="typeTemplate"> |
| 666 <span> |
| 667 <span>string</span> |
| 668 </span> |
| 669 </span> |
| 670 ) |
| 671 </div> |
| 672 </em> |
| 673 </dt> |
| 674 <dd>Value of the HTTP header if it can be represented by UTF-8.</dd> |
| 675 <!-- OBJECT PROPERTIES --> |
| 676 <!-- OBJECT METHODS --> |
| 677 <!-- OBJECT EVENT FIELDS --> |
| 678 <!-- FUNCTION PARAMETERS --> |
| 679 </div> |
| 680 </div><div> |
| 681 <div> |
| 682 <dt> |
| 683 <var>binaryValue</var> |
| 684 <em> |
| 685 <!-- TYPE --> |
| 686 <div style="display:inline"> |
| 687 ( |
| 688 <span class="optional">optional</span> |
| 689 <span id="typeTemplate"> |
| 690 <span> |
| 691 <span> |
| 692 array of <span><span> |
| 693 <span> |
| 694 <span>integer</span> |
| 695 </span> |
| 696 </span></span> |
| 697 </span> |
| 698 </span> |
| 699 </span> |
| 700 ) |
| 701 </div> |
| 702 </em> |
| 703 </dt> |
| 704 <dd>Value of the HTTP header if it cannot be represented by UTF-8, sto
red as individual byte values (0..255).</dd> |
| 705 <!-- OBJECT PROPERTIES --> |
| 706 <!-- OBJECT METHODS --> |
| 707 <!-- OBJECT EVENT FIELDS --> |
| 708 <!-- FUNCTION PARAMETERS --> |
| 709 </div> |
| 656 </div> | 710 </div> |
| 657 <div class="description"> | 711 </dl> |
| 658 <p>Fired when a call is made to tts.stop and this extension may
be in the middle of speaking. If an extension receives a call to onStop and spee
ch is already stopped, it should do nothing (not raise an error).</p> | 712 </dd> |
| 659 <!-- LISTENER PARAMETERS --> | 713 <!-- OBJECT METHODS --> |
| 660 <!-- EXTRA PARAMETERS --> | 714 <!-- OBJECT EVENT FIELDS --> |
| 661 <!-- LISTENER RETURN VALUE --> | 715 <!-- FUNCTION PARAMETERS --> |
| 662 <dl> | 716 </div> |
| 663 </dl> | |
| 664 </div> <!-- /description --> | |
| 665 </div> <!-- /apiItem --> | 717 </div> <!-- /apiItem --> |
| 666 </div> <!-- /apiGroup --> | 718 </div> <!-- /apiGroup --> |
| 667 <!-- TYPES --> | |
| 668 <!-- /apiGroup --> | |
| 669 </div> <!-- /apiPage --> | 719 </div> <!-- /apiPage --> |
| 670 </div> <!-- /gc-pagecontent --> | 720 </div> <!-- /gc-pagecontent --> |
| 671 </div> <!-- /g-section --> | 721 </div> <!-- /g-section --> |
| 672 </div> <!-- /codesiteContent --> | 722 </div> <!-- /codesiteContent --> |
| 673 <div id="gc-footer" --=""> | 723 <div id="gc-footer" --=""> |
| 674 <div class="text"> | 724 <div class="text"> |
| 675 <p> | 725 <p> |
| 676 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | 726 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, |
| 677 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | 727 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons |
| 678 Attribution 3.0 License</a>, and code samples are licensed under the | 728 Attribution 3.0 License</a>, and code samples are licensed under the |
| (...skipping 18 matching lines...) Expand all Loading... |
| 697 _uff=0; | 747 _uff=0; |
| 698 urchinTracker(); | 748 urchinTracker(); |
| 699 } | 749 } |
| 700 catch(e) {/* urchinTracker not available. */} | 750 catch(e) {/* urchinTracker not available. */} |
| 701 </script> | 751 </script> |
| 702 <!-- end analytics --> | 752 <!-- end analytics --> |
| 703 </div> | 753 </div> |
| 704 </div> <!-- /gc-footer --> | 754 </div> <!-- /gc-footer --> |
| 705 </div> <!-- /gc-container --> | 755 </div> <!-- /gc-container --> |
| 706 </body></html> | 756 </body></html> |
| OLD | NEW |