Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: chrome/common/extensions/docs/experimental.downloads.html

Issue 9452019: experimental.downloads extension api docs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 ]
265 "voice_name": "Alice",
266 "lang": "en-US",
267 "gender": "female",
268 "event_types": ["start", "marker", "end"]
269 },
270 {
271 "voice_name": "Pat",
272 "lang": "en-US",
273 "event_types": ["end"]
274 }
275 ]
276 },</b>
277 "background_page": "background.html",
278 }</pre> 257 }</pre>
279 <p>An extension can specify any number of voices.</p> 258 <p>If the URL’s hostname is not specified in the permissions, then the
280 <p>The <code>voice_name</code> parameter is required. The name should be 259 chrome.extensions.lastError object will indicate that the extension does not
281 descriptive enough that it identifies the name of the voice and the 260 have permission to access that hostname.
282 engine used. In the unlikely event that two extensions register voices 261 <a href="#properties">downloads.ERROR_*</a> are some of the errors that may be
283 with the same name, a client can specify the ID of the extension that 262 returned.</p>
284 should do the synthesis.</p> 263 <h2 id="examples"> Examples </h2>
285 <p>The <code>gender</code> parameter is optional. If your voice corresponds 264 <p>You can find simple examples of using the downloads module in the
286 to a male or female voice, you can use this parameter to help clients 265 <a href="http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extension s/docs/examples/api/downloads/">examples/api/downloads</a>
287 choose the most appropriate voice for their application.</p> 266 directory. For other examples and for help in viewing the source code, see
288 <p>The <code>lang</code> parameter is optional, but highly recommended. 267 <a href="samples.html">Samples</a>.</p>
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> 268 </div>
360 <!-- API PAGE --> 269 <!-- API PAGE -->
361 <div class="apiPage"> 270 <div class="apiPage">
362 <a name="apiReference"></a> 271 <a name="apiReference"></a>
363 <h2>API reference: chrome.ttsEngine</h2> 272 <h2>API reference: chrome.experimental.downloads</h2>
364 <!-- PROPERTIES --> 273 <!-- PROPERTIES -->
365 <!-- /apiGroup --> 274 <div class="apiGroup">
275 <a name="properties"></a>
276 <h3 id="properties">Properties</h3>
277 <div>
278 <a name="property-ERROR_GENERIC"></a>
279 <h4>ERROR_GENERIC</h4>
280 <div class="summary">
281 <!-- Note: intentionally longer 80 columns -->
282 <span>chrome.experimental.downloads.</span><span>ERROR_GENERIC</ span>
283 </div>
284 <div>
285 <dt>
286 <var>ERROR_GENERIC</var>
287 <em>
288 <!-- TYPE -->
289 <div style="display:inline">
290 (
291 <span id="typeTemplate">
292 <code>"I'm afraid I can't do that."</code>
293 </span>
294 )
295 </div>
296 </em>
297 </dt>
298 <dd>Generic error.</dd>
299 <!-- OBJECT PROPERTIES -->
300 <!-- OBJECT METHODS -->
301 <!-- OBJECT EVENT FIELDS -->
302 <!-- FUNCTION PARAMETERS -->
303 </div>
304 </div><div>
305 <a name="property-ERROR_INVALID_URL"></a>
306 <h4>ERROR_INVALID_URL</h4>
307 <div class="summary">
308 <!-- Note: intentionally longer 80 columns -->
309 <span>chrome.experimental.downloads.</span><span>ERROR_INVALID_U RL</span>
310 </div>
311 <div>
312 <dt>
313 <var>ERROR_INVALID_URL</var>
314 <em>
315 <!-- TYPE -->
316 <div style="display:inline">
317 (
318 <span id="typeTemplate">
319 <code>"Invalid URL."</code>
320 </span>
321 )
322 </div>
323 </em>
324 </dt>
325 <dd>The URL was invalid.</dd>
326 <!-- OBJECT PROPERTIES -->
327 <!-- OBJECT METHODS -->
328 <!-- OBJECT EVENT FIELDS -->
329 <!-- FUNCTION PARAMETERS -->
330 </div>
331 </div>
332 </div> <!-- /apiGroup -->
366 <!-- METHODS --> 333 <!-- METHODS -->
367 <div id="methodsTemplate" class="apiGroup"> 334 <div id="methodsTemplate" class="apiGroup">
368 <a name="global-methods"></a> 335 <a name="global-methods"></a>
369 <h3>Methods</h3> 336 <h3>Methods</h3>
370 <!-- iterates over all functions --> 337 <!-- 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"> 338 <div class="apiItem">
379 <a name="event-onSpeak"></a> 339 <a name="method-download"></a> <!-- method-anchor -->
380 <h4>onSpeak</h4> 340 <h4>download</h4>
381 <div class="summary"> 341 <div class="summary">
382 <!-- Note: intentionally longer 80 columns --> 342 <!-- 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>); 343 <span>chrome.experimental.downloads.download</span>(<span clas s="null"><span>object</span>
384 </div> 344 <var><span>options</span></var></span><span class="optiona l"><span>, </span><span>function</span>
345 <var><span>callback</span></var></span>)</div>
385 <div class="description"> 346 <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> 347 <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 --> 348 <!-- PARAMETERS -->
388 <div> 349 <h4>Parameters</h4>
389 <h4>Listener parameters</h4> 350 <dl>
390 <dl> 351 <div>
391 <div> 352 <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> 353 <dt>
417 <var>options</var> 354 <var>options</var>
418 <em> 355 <em>
419 <!-- TYPE --> 356 <!-- TYPE -->
420 <div style="display:inline"> 357 <div style="display:inline">
421 ( 358 (
422 <span id="typeTemplate"> 359 <span id="typeTemplate">
423 <span> 360 <span>
424 <span>object</span> 361 <span>object</span>
425 </span> 362 </span>
426 </span> 363 </span>
427 ) 364 )
428 </div> 365 </div>
429 </em> 366 </em>
430 </dt> 367 </dt>
431 <dd>Options specified to the tts.speak() method.</dd> 368 <dd class="todo">
369 Undocumented.
370 </dd>
432 <!-- OBJECT PROPERTIES --> 371 <!-- OBJECT PROPERTIES -->
433 <dd> 372 <dd>
434 <dl> 373 <dl>
435 <div> 374 <div>
436 <div> 375 <div>
437 <dt> 376 <dt>
438 <var>voiceName</var> 377 <var>url</var>
439 <em> 378 <em>
440 <!-- TYPE --> 379 <!-- TYPE -->
441 <div style="display:inline"> 380 <div style="display:inline">
442 ( 381 (
443 <span class="optional">optional</span>
444 <span id="typeTemplate"> 382 <span id="typeTemplate">
445 <span> 383 <span>
446 <span>string</span> 384 <span>string</span>
447 </span> 385 </span>
448 </span> 386 </span>
449 ) 387 )
450 </div> 388 </div>
451 </em> 389 </em>
452 </dt> 390 </dt>
453 <dd>The name of the voice to use for synthesis.</dd> 391 <dd>The URL to download.</dd>
454 <!-- OBJECT PROPERTIES --> 392 <!-- OBJECT PROPERTIES -->
455 <!-- OBJECT METHODS --> 393 <!-- OBJECT METHODS -->
456 <!-- OBJECT EVENT FIELDS --> 394 <!-- OBJECT EVENT FIELDS -->
457 <!-- FUNCTION PARAMETERS --> 395 <!-- FUNCTION PARAMETERS -->
458 </div> 396 </div>
459 </div><div> 397 </div><div>
460 <div> 398 <div>
461 <dt> 399 <dt>
462 <var>lang</var> 400 <var>filename</var>
463 <em> 401 <em>
464 <!-- TYPE --> 402 <!-- TYPE -->
465 <div style="display:inline"> 403 <div style="display:inline">
466 ( 404 (
467 <span class="optional">optional</span> 405 <span class="optional">optional</span>
468 <span id="typeTemplate"> 406 <span id="typeTemplate">
469 <span> 407 <span>
470 <span>string</span> 408 <span>string</span>
471 </span> 409 </span>
472 </span> 410 </span>
473 ) 411 )
474 </div> 412 </div>
475 </em> 413 </em>
476 </dt> 414 </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> 415 <dd>A file path relative to the Downloads directory to contain the dow nloaded file.</dd>
478 <!-- OBJECT PROPERTIES --> 416 <!-- OBJECT PROPERTIES -->
479 <!-- OBJECT METHODS --> 417 <!-- OBJECT METHODS -->
480 <!-- OBJECT EVENT FIELDS --> 418 <!-- OBJECT EVENT FIELDS -->
481 <!-- FUNCTION PARAMETERS --> 419 <!-- FUNCTION PARAMETERS -->
482 </div> 420 </div>
483 </div><div> 421 </div><div>
484 <div> 422 <div>
485 <dt> 423 <dt>
486 <var>gender</var> 424 <var>saveAs</var>
487 <em> 425 <em>
488 <!-- TYPE --> 426 <!-- TYPE -->
489 <div style="display:inline"> 427 <div style="display:inline">
490 ( 428 (
491 <span class="optional">optional</span> 429 <span class="optional">optional</span>
492 <span class="enum">enumerated</span>
493 <span id="typeTemplate"> 430 <span id="typeTemplate">
494 <span> 431 <span>
495 <span>string</span> 432 <span>boolean</span>
496 <span>["male", "female"]</span>
497 </span> 433 </span>
498 </span> 434 </span>
499 ) 435 )
500 </div> 436 </div>
501 </em> 437 </em>
502 </dt> 438 </dt>
503 <dd>Gender of voice for synthesized speech.</dd> 439 <dd>Use a file-chooser to allow the user to select a filename.</dd>
504 <!-- OBJECT PROPERTIES --> 440 <!-- OBJECT PROPERTIES -->
505 <!-- OBJECT METHODS --> 441 <!-- OBJECT METHODS -->
506 <!-- OBJECT EVENT FIELDS --> 442 <!-- OBJECT EVENT FIELDS -->
507 <!-- FUNCTION PARAMETERS --> 443 <!-- FUNCTION PARAMETERS -->
508 </div> 444 </div>
509 </div><div> 445 </div><div>
510 <div> 446 <div>
511 <dt> 447 <dt>
512 <var>rate</var> 448 <var>method</var>
513 <em> 449 <em>
514 <!-- TYPE --> 450 <!-- TYPE -->
515 <div style="display:inline"> 451 <div style="display:inline">
516 ( 452 (
517 <span class="optional">optional</span> 453 <span class="optional">optional</span>
454 <span class="enum">enumerated</span>
518 <span id="typeTemplate"> 455 <span id="typeTemplate">
519 <span> 456 <span>
520 <span>number</span> 457 <span>string</span>
458 <span>["GET", "POST"]</span>
521 </span> 459 </span>
522 </span> 460 </span>
523 ) 461 )
524 </div> 462 </div>
525 </em> 463 </em>
526 </dt> 464 </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> 465 <dd>The HTTP method to use if the URL uses the HTTP[S] protocol.</dd>
528 <!-- OBJECT PROPERTIES --> 466 <!-- OBJECT PROPERTIES -->
529 <!-- OBJECT METHODS --> 467 <!-- OBJECT METHODS -->
530 <!-- OBJECT EVENT FIELDS --> 468 <!-- OBJECT EVENT FIELDS -->
531 <!-- FUNCTION PARAMETERS --> 469 <!-- FUNCTION PARAMETERS -->
532 </div> 470 </div>
533 </div><div> 471 </div><div>
534 <div> 472 <div>
535 <dt> 473 <dt>
536 <var>pitch</var> 474 <var>headers</var>
537 <em> 475 <em>
538 <!-- TYPE --> 476 <!-- TYPE -->
539 <div style="display:inline"> 477 <div style="display:inline">
540 ( 478 (
541 <span class="optional">optional</span> 479 <span class="optional">optional</span>
542 <span id="typeTemplate"> 480 <span id="typeTemplate">
543 <span> 481 <span>
544 <span>number</span> 482 <a href="webRequest.html#type-HttpHeaders">HttpHeaders</ a>
545 </span> 483 </span>
546 </span> 484 </span>
547 ) 485 )
548 </div> 486 </div>
549 </em> 487 </em>
550 </dt> 488 </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> 489 <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 --> 490 <!-- OBJECT PROPERTIES -->
553 <!-- OBJECT METHODS --> 491 <!-- OBJECT METHODS -->
554 <!-- OBJECT EVENT FIELDS --> 492 <!-- OBJECT EVENT FIELDS -->
555 <!-- FUNCTION PARAMETERS --> 493 <!-- FUNCTION PARAMETERS -->
556 </div> 494 </div>
557 </div><div> 495 </div><div>
558 <div> 496 <div>
559 <dt> 497 <dt>
560 <var>volume</var> 498 <var>body</var>
561 <em> 499 <em>
562 <!-- TYPE --> 500 <!-- TYPE -->
563 <div style="display:inline"> 501 <div style="display:inline">
564 ( 502 (
565 <span class="optional">optional</span> 503 <span class="optional">optional</span>
566 <span id="typeTemplate"> 504 <span id="typeTemplate">
567 <span> 505 <span>
568 <span>number</span> 506 <span>string</span>
569 </span> 507 </span>
570 </span> 508 </span>
571 ) 509 )
572 </div> 510 </div>
573 </em> 511 </em>
574 </dt> 512 </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> 513 <dd>post body</dd>
576 <!-- OBJECT PROPERTIES --> 514 <!-- OBJECT PROPERTIES -->
577 <!-- OBJECT METHODS --> 515 <!-- OBJECT METHODS -->
578 <!-- OBJECT EVENT FIELDS --> 516 <!-- OBJECT EVENT FIELDS -->
579 <!-- FUNCTION PARAMETERS --> 517 <!-- FUNCTION PARAMETERS -->
580 </div> 518 </div>
581 </div> 519 </div>
582 </dl> 520 </dl>
583 </dd> 521 </dd>
584 <!-- OBJECT METHODS --> 522 <!-- OBJECT METHODS -->
585 <!-- OBJECT EVENT FIELDS --> 523 <!-- OBJECT EVENT FIELDS -->
586 <!-- FUNCTION PARAMETERS --> 524 <!-- FUNCTION PARAMETERS -->
587 </div> 525 </div>
588 </div><div> 526 </div><div>
589 <div> 527 <div>
590 <dt> 528 <dt>
591 <var>sendTtsEvent</var> 529 <var>callback</var>
592 <em> 530 <em>
593 <!-- TYPE --> 531 <!-- TYPE -->
594 <div style="display:inline"> 532 <div style="display:inline">
595 ( 533 (
534 <span class="optional">optional</span>
596 <span id="typeTemplate"> 535 <span id="typeTemplate">
597 <span> 536 <span>
598 <span>function</span> 537 <span>function</span>
599 </span> 538 </span>
600 </span> 539 </span>
601 ) 540 )
602 </div> 541 </div>
603 </em> 542 </em>
604 </dt> 543 </dt>
605 <dd>Call this function with events that occur in the process of speaki ng the utterance.</dd> 544 <dd class="todo">
545 Undocumented.
546 </dd>
606 <!-- OBJECT PROPERTIES --> 547 <!-- OBJECT PROPERTIES -->
607 <!-- OBJECT METHODS --> 548 <!-- OBJECT METHODS -->
608 <!-- OBJECT EVENT FIELDS --> 549 <!-- OBJECT EVENT FIELDS -->
609 <!-- FUNCTION PARAMETERS --> 550 <!-- FUNCTION PARAMETERS -->
610 <dd> 551 </div>
611 <div> 552 </div>
612 <h5>Parameters</h5> 553 </dl>
613 <dl> 554 <!-- RETURNS -->
614 <div> 555 <dl>
615 <div> 556 </dl>
557 <!-- CALLBACK -->
558 <div>
559 <div>
560 <h4>Callback function</h4>
561 <p>
562 If you specify the <em>callback</em> parameter, it should
563 specify a function that looks like this:
564 </p>
565 <!-- Note: intentionally longer 80 columns -->
566 <pre>function(<span>integer downloadId</span>) <span class="su bdued">{...}</span>;</pre>
567 <dl>
568 <div>
569 <div>
616 <dt> 570 <dt>
617 <var>event</var> 571 <var>downloadId</var>
618 <em> 572 <em>
619 <!-- TYPE --> 573 <!-- TYPE -->
620 <div style="display:inline"> 574 <div style="display:inline">
621 ( 575 (
622 <span id="typeTemplate"> 576 <span id="typeTemplate">
623 <span> 577 <span>
624 <a href="tts.html#type-TtsEvent">TtsEvent</a> 578 <span>integer</span>
625 </span> 579 </span>
626 </span> 580 </span>
627 ) 581 )
628 </div> 582 </div>
629 </em> 583 </em>
630 </dt> 584 </dt>
631 <dd>The event from the text-to-speech engine indicating the status of this utterance.</dd> 585 <dd>If not null, the identifier of the resulting Download Item.</dd>
632 <!-- OBJECT PROPERTIES --> 586 <!-- OBJECT PROPERTIES -->
633 <!-- OBJECT METHODS --> 587 <!-- OBJECT METHODS -->
634 <!-- OBJECT EVENT FIELDS --> 588 <!-- OBJECT EVENT FIELDS -->
635 <!-- FUNCTION PARAMETERS --> 589 <!-- FUNCTION PARAMETERS -->
636 </div> 590 </div>
637 </div>
638 </dl>
639 </div>
640 </dd>
641 </div>
642 </div> 591 </div>
643 </dl> 592 </dl>
593 </div>
644 </div> 594 </div>
645 <!-- EXTRA PARAMETERS --> 595 <!-- MIN_VERSION -->
646 <!-- LISTENER RETURN VALUE -->
647 <dl>
648 </dl>
649 </div> <!-- /description --> 596 </div> <!-- /description -->
650 </div><div class="apiItem"> 597 </div> <!-- /apiItem -->
651 <a name="event-onStop"></a> 598 </div> <!-- /apiGroup -->
652 <h4>onStop</h4> 599 <!-- EVENTS -->
653 <div class="summary"> 600 <!-- /apiGroup -->
654 <!-- Note: intentionally longer 80 columns --> 601 <!-- 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>); 602 <div class="apiGroup">
603 <a name="types"></a>
604 <h3 id="types">Types</h3>
605 <!-- iterates over all types -->
606 <div class="apiItem">
607 <a name="type-HttpHeaders"></a>
608 <h4>HttpHeaders</h4>
609 <div>
610 <dt>
611 <em>
612 <!-- TYPE -->
613 <div style="display:inline">
614 (
615 <span id="typeTemplate">
616 <span>
617 <span>
618 array of <span><span>
619 <span>
620 <span>object</span>
621 </span>
622 </span></span>
623 </span>
624 </span>
625 </span>
626 )
627 </div>
628 </em>
629 </dt>
630 <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>
631 <!-- OBJECT PROPERTIES -->
632 <dd>
633 <dl>
634 <div>
635 <div>
636 <dt>
637 <var>name</var>
638 <em>
639 <!-- TYPE -->
640 <div style="display:inline">
641 (
642 <span id="typeTemplate">
643 <span>
644 <span>string</span>
645 </span>
646 </span>
647 )
648 </div>
649 </em>
650 </dt>
651 <dd>Name of the HTTP header.</dd>
652 <!-- OBJECT PROPERTIES -->
653 <!-- OBJECT METHODS -->
654 <!-- OBJECT EVENT FIELDS -->
655 <!-- FUNCTION PARAMETERS -->
656 </div>
657 </div><div>
658 <div>
659 <dt>
660 <var>value</var>
661 <em>
662 <!-- TYPE -->
663 <div style="display:inline">
664 (
665 <span class="optional">optional</span>
666 <span id="typeTemplate">
667 <span>
668 <span>string</span>
669 </span>
670 </span>
671 )
672 </div>
673 </em>
674 </dt>
675 <dd>Value of the HTTP header if it can be represented by UTF-8.</dd>
676 <!-- OBJECT PROPERTIES -->
677 <!-- OBJECT METHODS -->
678 <!-- OBJECT EVENT FIELDS -->
679 <!-- FUNCTION PARAMETERS -->
680 </div>
681 </div><div>
682 <div>
683 <dt>
684 <var>binaryValue</var>
685 <em>
686 <!-- TYPE -->
687 <div style="display:inline">
688 (
689 <span class="optional">optional</span>
690 <span id="typeTemplate">
691 <span>
692 <span>
693 array of <span><span>
694 <span>
695 <span>integer</span>
696 </span>
697 </span></span>
698 </span>
699 </span>
700 </span>
701 )
702 </div>
703 </em>
704 </dt>
705 <dd>Value of the HTTP header if it cannot be represented by UTF-8, sto red as individual byte values (0..255).</dd>
706 <!-- OBJECT PROPERTIES -->
707 <!-- OBJECT METHODS -->
708 <!-- OBJECT EVENT FIELDS -->
709 <!-- FUNCTION PARAMETERS -->
710 </div>
656 </div> 711 </div>
657 <div class="description"> 712 </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> 713 </dd>
659 <!-- LISTENER PARAMETERS --> 714 <!-- OBJECT METHODS -->
660 <!-- EXTRA PARAMETERS --> 715 <!-- OBJECT EVENT FIELDS -->
661 <!-- LISTENER RETURN VALUE --> 716 <!-- FUNCTION PARAMETERS -->
662 <dl> 717 </div>
663 </dl>
664 </div> <!-- /description -->
665 </div> <!-- /apiItem --> 718 </div> <!-- /apiItem -->
666 </div> <!-- /apiGroup --> 719 </div> <!-- /apiGroup -->
667 <!-- TYPES -->
668 <!-- /apiGroup -->
669 </div> <!-- /apiPage --> 720 </div> <!-- /apiPage -->
670 </div> <!-- /gc-pagecontent --> 721 </div> <!-- /gc-pagecontent -->
671 </div> <!-- /g-section --> 722 </div> <!-- /g-section -->
672 </div> <!-- /codesiteContent --> 723 </div> <!-- /codesiteContent -->
673 <div id="gc-footer" --=""> 724 <div id="gc-footer" --="">
674 <div class="text"> 725 <div class="text">
675 <p> 726 <p>
676 Except as otherwise <a href="http://code.google.com/policies.html#restrictions ">noted</a>, 727 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 728 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 729 Attribution 3.0 License</a>, and code samples are licensed under the
(...skipping 18 matching lines...) Expand all
697 _uff=0; 748 _uff=0;
698 urchinTracker(); 749 urchinTracker();
699 } 750 }
700 catch(e) {/* urchinTracker not available. */} 751 catch(e) {/* urchinTracker not available. */}
701 </script> 752 </script>
702 <!-- end analytics --> 753 <!-- end analytics -->
703 </div> 754 </div>
704 </div> <!-- /gc-footer --> 755 </div> <!-- /gc-footer -->
705 </div> <!-- /gc-container --> 756 </div> <!-- /gc-container -->
706 </body></html> 757 </body></html>
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/experimental.html ('k') | chrome/common/extensions/docs/experimental.managedMode.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698