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 3 across api docs and should be edited only with knowledge of the 4 templating mechanism. 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 7 authored overview content. 8 4) The <body>.innerHTML is also generated by an offline step so that this 9 page may easily be indexed by search engines. 10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> 11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> 13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> 14 <script type="text/javascript" src="../../../third_party/jstemplate/jstemplate_compiled.js"> 15 </script> 16 <script type="text/javascript" src="js/api_page_generator.js"></script> 17 <script type="text/javascript" src="js/bootstrap.js"></script> 18 <script type="text/javascript" src="js/sidebar.js"></script> 19 <title>chrome.experimental.tts - Google Chrome Extensions - Google Code</title></head> 20 <body> <div id="gc-container" class="labs"> 21 <div id="devModeWarning"> 22 You are viewing extension docs in chrome via the 'file:' scheme: are you expecting to see local changes when you refresh? You'll need run chrome with --allow-file-access-from-files. 23 </div> 24 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> 25 <!-- In particular, sub-templates that recurse, must be used by allowing 26 jstemplate to make a copy of the template in this section which 27 are not operated on by way of the jsskip="true" --> 28 <div style="display:none"> 29 30 <!-- VALUE --> 31 <div id="valueTemplate"> 32 <dt> 33 <var>paramName</var> 34 <em> 35 36 <!-- TYPE --> 37 <div style="display:inline"> 38 ( 39 <span class="optional">optional</span> 40 <span class="enum">enumerated</span> 41 <span id="typeTemplate"> 42 <span> 43 <a> Type</a> 44 </span> 45 <span> 46 <span> 47 array of <span><span></span></span> 48 </span> 49 <span>paramType</span> 50 <span></span> 51 </span> 52 </span> 53 ) 54 </div> 55 56 </em> 57 </dt> 58 <dd class="todo"> 59 Undocumented. 60 </dd> 61 <dd> 62 Description of this parameter from the json schema. 63 </dd> 64 <dd> 65 This parameter was added in version 66 <b><span></span></b>. 67 You must omit this parameter in earlier versions, 68 and you may omit it in any version. If you require this 69 parameter, the manifest key 70 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 71 can ensure that your extension won't be run in an earlier browser version. 72 </dd> 73 74 <!-- OBJECT PROPERTIES --> 75 <dd> 76 <dl> 77 <div> 78 <div> 79 </div> 80 </div> 81 </dl> 82 </dd> 83 84 <!-- OBJECT METHODS --> 85 <dd> 86 <div></div> 87 </dd> 88 89 <!-- OBJECT EVENT FIELDS --> 90 <dd> 91 <div></div> 92 </dd> 93 94 <!-- FUNCTION PARAMETERS --> 95 <dd> 96 <div></div> 97 </dd> 98 99 </div> <!-- /VALUE --> 100 101 <div id="functionParametersTemplate"> 102 <h5>Parameters</h5> 103 <dl> 104 <div> 105 <div> 106 </div> 107 </div> 108 </dl> 109 </div> 110 </div> <!-- /SUBTEMPLATES --> 111 112 <a id="top"></a> 113 <div id="skipto"> 114 <a href="#gc-pagecontent">Skip to page content</a> 115 <a href="#gc-toc">Skip to main navigation</a> 116 </div> 117 <!-- API HEADER --> 118 <table id="header" width="100%" cellspacing="0" border="0"> 119 <tbody><tr> 120 <td valign="middle"><a href="http://code.google.com/"><img src="images/code_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:0; margin:0;"></a></td> 121 <td valign="middle" width="100%" style="padding-left:0.6em;"> 122 <form action="http://www.google.com/cse" id="cse" style="margin-top:0.5em"> 123 <div id="gsc-search-box"> 124 <input type="hidden" name="cx" value="002967670403910741006:61_cvzfqtno"> 125 <input type="hidden" name="ie" value="UTF-8"> 126 <input type="text" name="q" value="" size="55"> 127 <input class="gsc-search-button" type="submit" name="sa" value="Search"> 128 <br> 129 <span class="greytext">e.g. "page action" or "tabs"</span> 130 </div> 131 </form> 132 133 <script type="text/javascript" src="http://www.google.com/jsapi"></script> 134 <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script> 135 <script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse&t13n_langs=en"></script> 136 <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse&lang=en"></script> 137 </td> 138 </tr> 139 </tbody></table> 140 141 <div id="codesiteContent" class=""> 142 143 <a id="gc-topnav-anchor"></a> 144 <div id="gc-topnav"> 145 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Labs</a>)</h1> 146 <ul id="home" class="gc-topnav-tabs"> 147 <li id="home_link"> 148 <a href="index.html" title="Google Chrome Extensions home page">Home</a> 149 </li> 150 <li id="docs_link"> 151 <a href="docs.html" title="Official Google Chrome Extensions documentation">Docs</a> 152 </li> 153 <li id="faq_link"> 154 <a href="faq.html" title="Answers to frequently asked questions about Google Chrome Extensions">FAQ</a> 155 </li> 156 <li id="samples_link"> 157 <a href="samples.html" title="Sample extensions (with source code)">Samples</a> 158 </li> 159 <li id="group_link"> 160 <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions" title="Google Chrome Extensions developer forum">Group</a> 161 </li> 162 </ul> 163 </div> <!-- end gc-topnav --> 164 165 <div class="g-section g-tpl-170"> 166 <!-- SIDENAV --> 167 <div class="g-unit g-first" id="gc-toc"> 168 <ul> 169 <li><a href="getstarted.html">Getting Started</a></li> 170 <li><a href="overview.html">Overview</a></li> 171 <li><a href="whats_new.html">What's New?</a></li> 172 <li><h2><a href="devguide.html">Developer's Guide</a></h2> 173 <ul> 174 <li>Browser UI 175 <ul> 176 <li><a href="browserAction.html">Browser Actions</a></li> 177 <li><a href="contextMenus.html">Context Menus</a></li> 178 <li><a href="notifications.html">Desktop Notifications</a></li> 179 <li><a href="omnibox.html">Omnibox</a></li> 180 <li><a href="options.html">Options Pages</a></li> 181 <li><a href="override.html">Override Pages</a></li> 182 <li><a href="pageAction.html">Page Actions</a></li> 183 </ul> 184 </li> 185 <li>Browser Interaction 186 <ul> 187 <li><a href="bookmarks.html">Bookmarks</a></li> 188 <li><a href="cookies.html">Cookies</a></li> 189 <li><a href="events.html">Events</a></li> 190 <li><a href="history.html">History</a></li> 191 <li><a href="management.html">Management</a></li> 192 <li><a href="tabs.html">Tabs</a></li> 193 <li><a href="windows.html">Windows</a></li> 194 </ul> 195 </li> 196 <li>Implementation 197 <ul> 198 <li><a href="a11y.html">Accessibility</a></li> 199 <li><a href="background_pages.html">Background Pages</a></li> 200 <li><a href="content_scripts.html">Content Scripts</a></li> 201 <li><a href="xhr.html">Cross-Origin XHR</a></li> 202 <li><a href="idle.html">Idle</a></li> 203 <li><a href="i18n.html">Internationalization</a></li> 204 <li><a href="messaging.html">Message Passing</a></li> 205 <li><a href="npapi.html">NPAPI Plugins</a></li> 206 </ul> 207 </li> 208 <li>Finishing 209 <ul> 210 <li><a href="hosting.html">Hosting</a></li> 211 <li><a href="external_extensions.html">Other Deployment Options</a></li> 212 </ul> 213 </li> 214 </ul> 215 </li> 216 <li><h2><a href="apps.html">Packaged Apps</a></h2></li> 217 <li><h2><a href="tutorials.html">Tutorials</a></h2> 218 <ul> 219 <li><a href="tut_debugging.html">Debugging</a></li> 220 <li><a href="tut_analytics.html">Google Analytics</a></li> 221 <li><a href="tut_oauth.html">OAuth</a></li> 222 </ul> 223 </li> 224 <li><h2>Reference</h2> 225 <ul> 226 <li>Formats 227 <ul> 228 <li><a href="manifest.html">Manifest Files</a></li> 229 <li><a href="match_patterns.html">Match Patterns</a></li> 230 </ul> 231 </li> 232 <li><a href="permission_warnings.html">Permission Warnings</a></li> 233 <li><a href="api_index.html">chrome.* APIs</a></li> 234 <li><a href="api_other.html">Other APIs</a></li> 235 </ul> 236 </li> 237 <li><h2><a href="samples.html">Samples</a></h2></li> 238 <div class="line"> </div> 239 <li><h2>More</h2> 240 <ul> 241 <li><a href="http://code.google.com/chrome/webstore/docs/index.html">Chrome Web Store</a></li> 242 <li><a href="http://code.google.com/chrome/apps/docs/developers_guide.html">Hosted Apps</a></li> 243 <li><a href="themes.html">Themes</a></li> 244 </ul> 245 </li> 246 </ul> 247 </div> 248 <script> 249 initToggles(); 250 </script> 251 252 <div class="g-unit" id="gc-pagecontent"> 253 <div id="pageTitle"> 254 <h1 class="page_title">chrome.experimental.tts</h1> 255 </div> 256 <!-- TABLE OF CONTENTS --> 257 <div id="toc"> 258 <h2>Contents</h2> 259 <ol> 260 <li> 261 <a href="#overview">Overview</a> 262 <ol> 263 <li style="display: none; "> 264 <a>h3Name</a> 265 </li> 266 </ol> 267 </li><li> 268 <a href="#generating_speech">Generating speech</a> 269 <ol> 270 <li style="display: none; "> 271 <a>h3Name</a> 272 </li> 273 </ol> 274 </li><li> 275 <a href="#ssml">SSML markup</a> 276 <ol> 277 <li style="display: none; "> 278 <a>h3Name</a> 279 </li> 280 </ol> 281 </li><li> 282 <a href="#provider">Implementing a speech provider</a> 283 <ol> 284 <li style="display: none; "> 285 <a>h3Name</a> 286 </li> 287 </ol> 288 </li> 289 <li> 290 <a href="#apiReference">API reference: chrome.experimental.tts</a> 291 <ol> 292 <li style="display: none; "> 293 <a href="#properties">Properties</a> 294 <ol> 295 <li> 296 <a href="#property-anchor">propertyName</a> 297 </li> 298 </ol> 299 </li> 300 <li> 301 <a href="#global-methods">Methods</a> 302 <ol> 303 <li> 304 <a href="#method-isSpeaking">isSpeaking</a> 305 </li><li> 306 <a href="#method-speak">speak</a> 307 </li><li style="display: none; "> 308 <a href="#method-anchor">methodName</a> 309 </li><li> 310 <a href="#method-stop">stop</a> 311 </li> 312 </ol> 313 </li> 314 <li> 315 <a href="#global-events">Events</a> 316 <ol> 317 <li> 318 <a href="#event-onSpeak">onSpeak</a> 319 </li><li> 320 <a href="#event-onStop">onStop</a> 321 </li> 322 </ol> 323 </li> 324 <li style="display: none; "> 325 <a href="#types">Types</a> 326 <ol> 327 <li> 328 <a href="#id-anchor">id</a> 329 </li> 330 </ol> 331 </li> 332 </ol> 333 </li> 334 </ol> 335 </div> 336 <!-- /TABLE OF CONTENTS --> 337 338 <!-- Standard content lead-in for experimental API pages --> 339 <p id="classSummary"> 340 For information on how to use experimental APIs, see the <a href="experimental.html">chrome.experimental.* APIs</a> page. 341 </p> 342 343 <!-- STATIC CONTENT PLACEHOLDER --> 344 <div id="static"><p id="classSummary"> 345 Use the <code>chrome.experimental.tts</code> module to play synthesized 346 text-to-speech (TTS) from your extension or packaged app, or to register 347 as a speech provider for other extensions and packaged apps that want to speak. 348 </p> 349 350 <p class="note"><b>Give us feedback:</b> If you have suggestions, 351 especially changes that should be made before stabilizing the first 352 version of this API, please send your ideas to the 353 <a href="http://groups.google.com/a/chromium.org/group/chromium-extensions">chromium-extensions</a> 354 group.</p> 355 356 <h2 id="overview">Overview</h2> 357 358 <p>To enable this experimental API, visit 359 <b>chrome://flags</b> and enable <b>Experimental Extension APIs</b>. 360 361 </p><p>Chrome provides native support for speech on Windows (using SAPI 362 5), Mac OS X, and Chrome OS, using speech synthesis capabilities 363 provided by the operating system. On all platforms, the user can 364 install extensions that register themselves as alternative speech 365 synthesis providers.</p> 366 367 <h2 id="generating_speech">Generating speech</h2> 368 369 <p>Call <code>speak()</code> from your extension or 370 packaged app to speak. For example:</p> 371 372 <pre>chrome.experimental.tts.speak('Hello, world.');</pre> 373 374 <p>You can provide options that control various properties of the speech, 375 such as its rate, pitch, and more. For example:</p> 376 377 <pre>chrome.experimental.tts.speak('Hello, world.', {'rate': 0.8});</pre> 378 379 <p>It's also a good idea to specify the locale so that a synthesizer 380 supporting that language (and regional dialect, if applicable) is chosen.</p> 381 382 <pre>chrome.experimental.tts.speak( 383 'Hello, world.', 384 { 385 'locale': 'en-US', 386 'rate': 0.8 387 });</pre> 388 389 <p>Not all speech engines will support all options.</p> 390 391 <p>You can also pass a callback function that will be called when the 392 speech has finished. For example, suppose we have an image on our page 393 displaying a picture of a face with a closed mouth. We could open the mouth 394 while speaking, and close it when done.</p> 395 396 <pre>faceImage.src = 'open_mouth.png'; 397 chrome.experimental.tts.speak( 398 'Hello, world.', null, function() { 399 faceImage.src = 'closed_mouth.png'; 400 }); 401 </pre> 402 403 <p>To stop speaking immediately, just call <code>stop()</code>. Call 404 <code>isSpeaking()</code> to find out if a TTS engine is currently speaking.</p> 405 406 <p>You can check to see if an error occurred by checking 407 <code>chrome.extension.lastError</code> inside the callback function.</p> 408 409 <h2 id="ssml">SSML markup</h2> 410 411 <p>Utterances used in this API may include markup using the 412 <a href="http://www.w3.org/TR/speech-synthesis">Speech Synthesis Markup 413 Language (SSML)</a>. For example: 414 415 </p><pre>chrome.experimental.tts.speak('The <emphasis>second</emphasis> word of this sentence was emphasized.');</pre> 416 417 <p>Not all speech engines will support all SSML tags, and some may not support 418 SSML at all, but all engines are expected to ignore any SSML they don't 419 support and still speak the underlying text.</p> 420 421 <h2 id="provider">Implementing a speech provider</h2> 422 423 <p>An extension can register itself as a speech provider. By doing so, it 424 can intercept some or all calls to functions such as 425 <code>speak()</code> and <code>stop()</code> and provide an alternate 426 implementation. Extensions are free to use any available web technology 427 to provide speech, including streaming audio from a server, HTML5 audio, 428 Native Client, or Flash. An extension could even do something different 429 with the utterances, like display closed captions in a pop-up window or 430 send them as log messages to a remote server.</p> 431 432 <p>To provide TTS, an extension must first declare all voices it provides 433 in the extension manifest, like this:</p> 434 435 <pre>{ 436 "name": "My TTS Provider", 437 "version": "1.0", 438 <b>"permissions": ["experimental"] 439 "tts": { 440 "voices": [ 441 { 442 "voiceName": "Alice", 443 "locale": "en-US", 444 "gender": "female" 445 }, 446 { 447 "voiceName": "Pat", 448 "locale": "en-US" 449 } 450 ] 451 },</b> 452 "background_page": "background.html", 453 }</pre> 454 455 <p>An extension can specify any number of voices. The three 456 parameters<code>voiceName</code>, <code>locale</code>, 457 and <code>gender</code>are all optional. If they are all unspecified, 458 the extension will handle all speech from all clients. If any of them 459 are specified, they can be used to filter speech requests. For 460 example, if a voice only supports French, it should set the locale to 461 'fr' (or something more specific like 'fr-FR') so that only utterances 462 in that locale are routed to that extension.</p> 463 464 <p>To handle speech calls, the extension should register listeners 465 for <code>onSpeak</code> and <code>onStop</code>, like this:</p> 466 467 <pre>var speakListener = function(utterance, options, callback) { 468 ... 469 callback(); 470 }; 471 var stopListener = function() { 472 ... 473 }; 474 chrome.experimental.tts.onSpeak.addListener(speakListener); 475 chrome.experimental.tts.onStop.addListener(stopListener);</pre> 476 477 <p class="warning"><b>Important:</b> Don't forget to call the callback 478 function from your speak listener!</p> 479 480 <p>If an extension does not register listeners for both 481 <code>onSpeak</code> and <code>onStop</code>, it will not intercept any 482 speech calls, regardless of what is in the manifest. 483 484 </p><p>The decision of whether or not to send a given speech request to an 485 extension is based solely on whether the extension supports the given voice 486 parameters in its manifest and has registered listeners 487 for <code>onSpeak</code> and <code>onStop</code>. In other words, 488 there's no way for an extension to receive a speech request and 489 dynamically decide whether to handle it or not.</p> 490 </div> 491 492 <!-- API PAGE --> 493 <div class="apiPage"> 494 <a name="apiReference"></a> 495 <h2>API reference: chrome.experimental.tts</h2> 496 497 <!-- PROPERTIES --> 498 <div class="apiGroup" style="display: none; "> 499 <a name="properties"></a> 500 <h3 id="properties">Properties</h3> 501 502 <div> 503 <a></a> 504 <h4>getLastError</h4> 505 <div class="summary"> 506 <!-- Note: intentionally longer 80 columns --> 507 <span>chrome.extension</span><span>lastError</span> 508 </div> 509 <div> 510 </div> 511 </div> 512 513 </div> <!-- /apiGroup --> 514 515 <!-- METHODS --> 516 <div id="methodsTemplate" class="apiGroup"> 517 <a name="global-methods"></a> 518 <h3>Methods</h3> 519 520 <!-- iterates over all functions --> 521 <div class="apiItem"> 522 <a name="method-isSpeaking"></a> <!-- method-anchor --> 523 <h4>isSpeaking</h4> 524 525 <div class="summary"><span style="display: none; ">void</span> 526 <!-- Note: intentionally longer 80 columns --> 527 <span>chrome.experimental.tts.isSpeaking</span>(<span class="optional"><span style="display: none; ">, </span><span>function</span> 528 <var><span>callback</span></var></span>)</div> 529 530 <div class="description"> 531 <p class="todo" style="display: none; ">Undocumented.</p> 532 <p>Check if the engine is currently speaking.</p> 533 534 <!-- PARAMETERS --> 535 <h4>Parameters</h4> 536 <dl> 537 <div> 538 <div> 539 <dt> 540 <var>callback</var> 541 <em> 542 543 <!-- TYPE --> 544 <div style="display:inline"> 545 ( 546 <span class="optional">optional</span> 547 <span class="enum" style="display: none; ">enumerated</span> 548 <span id="typeTemplate"> 549 <span style="display: none; "> 550 <a> Type</a> 551 </span> 552 <span> 553 <span style="display: none; "> 554 array of <span><span></span></span> 555 </span> 556 <span>function</span> 557 <span style="display: none; "></span> 558 </span> 559 </span> 560 ) 561 </div> 562 563 </em> 564 </dt> 565 <dd class="todo"> 566 Undocumented. 567 </dd> 568 <dd style="display: none; "> 569 Description of this parameter from the json schema. 570 </dd> 571 <dd style="display: none; "> 572 This parameter was added in version 573 <b><span></span></b>. 574 You must omit this parameter in earlier versions, 575 and you may omit it in any version. If you require this 576 parameter, the manifest key 577 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 578 can ensure that your extension won't be run in an earlier browser version. 579 </dd> 580 581 <!-- OBJECT PROPERTIES --> 582 <dd style="display: none; "> 583 <dl> 584 <div> 585 <div> 586 </div> 587 </div> 588 </dl> 589 </dd> 590 591 <!-- OBJECT METHODS --> 592 <dd style="display: none; "> 593 <div></div> 594 </dd> 595 596 <!-- OBJECT EVENT FIELDS --> 597 <dd style="display: none; "> 598 <div></div> 599 </dd> 600 601 <!-- FUNCTION PARAMETERS --> 602 <dd style="display: none; "> 603 <div></div> 604 </dd> 605 606 </div> 607 </div> 608 </dl> 609 610 <!-- RETURNS --> 611 <h4 style="display: none; ">Returns</h4> 612 <dl> 613 <div style="display: none; "> 614 <div> 615 </div> 616 </div> 617 </dl> 618 619 <!-- CALLBACK --> 620 <div> 621 <div> 622 <h4>Callback function</h4> 623 <p style="display: none; "> 624 The callback <em>parameter</em> should specify a function 625 that looks like this: 626 </p> 627 <p> 628 If you specify the <em>callback</em> parameter, it should 629 specify a function that looks like this: 630 </p> 631 632 <!-- Note: intentionally longer 80 columns --> 633 <pre>function(<span>boolean speaking</span>) <span class="subdued">{...}</span>;</pre> 634 <dl> 635 <div> 636 <div> 637 <dt> 638 <var>speaking</var> 639 <em> 640 641 <!-- TYPE --> 642 <div style="display:inline"> 643 ( 644 <span class="optional" style="display: none; ">optional</span> 645 <span class="enum" style="display: none; ">enumerated</span> 646 <span id="typeTemplate"> 647 <span style="display: none; "> 648 <a> Type</a> 649 </span> 650 <span> 651 <span style="display: none; "> 652 array of <span><span></span></span> 653 </span> 654 <span>boolean</span> 655 <span style="display: none; "></span> 656 </span> 657 </span> 658 ) 659 </div> 660 661 </em> 662 </dt> 663 <dd class="todo" style="display: none; "> 664 Undocumented. 665 </dd> 666 <dd>True if speaking, false otherwise.</dd> 667 <dd style="display: none; "> 668 This parameter was added in version 669 <b><span></span></b>. 670 You must omit this parameter in earlier versions, 671 and you may omit it in any version. If you require this 672 parameter, the manifest key 673 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 674 can ensure that your extension won't be run in an earlier browser version. 675 </dd> 676 677 <!-- OBJECT PROPERTIES --> 678 <dd style="display: none; "> 679 <dl> 680 <div> 681 <div> 682 </div> 683 </div> 684 </dl> 685 </dd> 686 687 <!-- OBJECT METHODS --> 688 <dd style="display: none; "> 689 <div></div> 690 </dd> 691 692 <!-- OBJECT EVENT FIELDS --> 693 <dd style="display: none; "> 694 <div></div> 695 </dd> 696 697 <!-- FUNCTION PARAMETERS --> 698 <dd style="display: none; "> 699 <div></div> 700 </dd> 701 702 </div> 703 </div> 704 </dl> 705 </div> 706 </div> 707 708 <!-- MIN_VERSION --> 709 <p style="display: none; "> 710 This function was added in version <b><span></span></b>. 711 If you require this function, the manifest key 712 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 713 can ensure that your extension won't be run in an earlier browser version. 714 </p> 715 </div> <!-- /description --> 716 717 </div><div class="apiItem"> 718 <a name="method-speak"></a> <!-- method-anchor --> 719 <h4>speak</h4> 720 721 <div class="summary"><span style="display: none; ">void</span> 722 <!-- Note: intentionally longer 80 columns --> 723 <span>chrome.experimental.tts.speak</span>(<span class="null"><span style="display: none; ">, </span><span>string</span> 724 <var><span>utterance</span></var></span><span class="optional"><span>, </span><span>object</span> 725 <var><span>options</span></var></span><span class="optional"><span>, </span><span>function</span> 726 <var><span>callback</span></var></span>)</div> 727 728 <div class="description"> 729 <p class="todo" style="display: none; ">Undocumented.</p> 730 <p>Speak text using a text-to-speech engine.</p> 731 732 <!-- PARAMETERS --> 733 <h4>Parameters</h4> 734 <dl> 735 <div> 736 <div> 737 <dt> 738 <var>utterance</var> 739 <em> 740 741 <!-- TYPE --> 742 <div style="display:inline"> 743 ( 744 <span class="optional" style="display: none; ">optional</span> 745 <span class="enum" style="display: none; ">enumerated</span> 746 <span id="typeTemplate"> 747 <span style="display: none; "> 748 <a> Type</a> 749 </span> 750 <span> 751 <span style="display: none; "> 752 array of <span><span></span></span> 753 </span> 754 <span>string</span> 755 <span style="display: none; "></span> 756 </span> 757 </span> 758 ) 759 </div> 760 761 </em> 762 </dt> 763 <dd class="todo" style="display: none; "> 764 Undocumented. 765 </dd> 766 <dd>The text to speak. May include SSML markup.</dd> 767 <dd style="display: none; "> 768 This parameter was added in version 769 <b><span></span></b>. 770 You must omit this parameter in earlier versions, 771 and you may omit it in any version. If you require this 772 parameter, the manifest key 773 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 774 can ensure that your extension won't be run in an earlier browser version. 775 </dd> 776 777 <!-- OBJECT PROPERTIES --> 778 <dd style="display: none; "> 779 <dl> 780 <div> 781 <div> 782 </div> 783 </div> 784 </dl> 785 </dd> 786 787 <!-- OBJECT METHODS --> 788 <dd style="display: none; "> 789 <div></div> 790 </dd> 791 792 <!-- OBJECT EVENT FIELDS --> 793 <dd style="display: none; "> 794 <div></div> 795 </dd> 796 797 <!-- FUNCTION PARAMETERS --> 798 <dd style="display: none; "> 799 <div></div> 800 </dd> 801 802 </div> 803 </div><div> 804 <div> 805 <dt> 806 <var>options</var> 807 <em> 808 809 <!-- TYPE --> 810 <div style="display:inline"> 811 ( 812 <span class="optional">optional</span> 813 <span class="enum" style="display: none; ">enumerated</span> 814 <span id="typeTemplate"> 815 <span style="display: none; "> 816 <a> Type</a> 817 </span> 818 <span> 819 <span style="display: none; "> 820 array of <span><span></span></span> 821 </span> 822 <span>object</span> 823 <span style="display: none; "></span> 824 </span> 825 </span> 826 ) 827 </div> 828 829 </em> 830 </dt> 831 <dd class="todo" style="display: none; "> 832 Undocumented. 833 </dd> 834 <dd>The speech options.</dd> 835 <dd style="display: none; "> 836 This parameter was added in version 837 <b><span></span></b>. 838 You must omit this parameter in earlier versions, 839 and you may omit it in any version. If you require this 840 parameter, the manifest key 841 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 842 can ensure that your extension won't be run in an earlier browser version. 843 </dd> 844 845 <!-- OBJECT PROPERTIES --> 846 <dd> 847 <dl> 848 <div> 849 <div> 850 <dt> 851 <var>enqueue</var> 852 <em> 853 854 <!-- TYPE --> 855 <div style="display:inline"> 856 ( 857 <span class="optional">optional</span> 858 <span class="enum" style="display: none; ">enumerated</span> 859 <span id="typeTemplate"> 860 <span style="display: none; "> 861 <a> Type</a> 862 </span> 863 <span> 864 <span style="display: none; "> 865 array of <span><span></span></span> 866 </span> 867 <span>boolean</span> 868 <span style="display: none; "></span> 869 </span> 870 </span> 871 ) 872 </div> 873 874 </em> 875 </dt> 876 <dd class="todo" style="display: none; "> 877 Undocumented. 878 </dd> 879 <dd>If true, enqueues this utterance if TTS is already in progress. If false (the default), interrupts any current speech and flushes the speech queue before speaking this new utterance.</dd> 880 <dd style="display: none; "> 881 This parameter was added in version 882 <b><span></span></b>. 883 You must omit this parameter in earlier versions, 884 and you may omit it in any version. If you require this 885 parameter, the manifest key 886 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 887 can ensure that your extension won't be run in an earlier browser version. 888 </dd> 889 890 <!-- OBJECT PROPERTIES --> 891 <dd style="display: none; "> 892 <dl> 893 <div> 894 <div> 895 </div> 896 </div> 897 </dl> 898 </dd> 899 900 <!-- OBJECT METHODS --> 901 <dd style="display: none; "> 902 <div></div> 903 </dd> 904 905 <!-- OBJECT EVENT FIELDS --> 906 <dd style="display: none; "> 907 <div></div> 908 </dd> 909 910 <!-- FUNCTION PARAMETERS --> 911 <dd style="display: none; "> 912 <div></div> 913 </dd> 914 915 </div> 916 </div><div> 917 <div> 918 <dt> 919 <var>voiceName</var> 920 <em> 921 922 <!-- TYPE --> 923 <div style="display:inline"> 924 ( 925 <span class="optional">optional</span> 926 <span class="enum" style="display: none; ">enumerated</span> 927 <span id="typeTemplate"> 928 <span style="display: none; "> 929 <a> Type</a> 930 </span> 931 <span> 932 <span style="display: none; "> 933 array of <span><span></span></span> 934 </span> 935 <span>string</span> 936 <span style="display: none; "></span> 937 </span> 938 </span> 939 ) 940 </div> 941 942 </em> 943 </dt> 944 <dd class="todo" style="display: none; "> 945 Undocumented. 946 </dd> 947 <dd>The name of the voice to use for synthesis. If empty, uses any available voice.</dd> 948 <dd style="display: none; "> 949 This parameter was added in version 950 <b><span></span></b>. 951 You must omit this parameter in earlier versions, 952 and you may omit it in any version. If you require this 953 parameter, the manifest key 954 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 955 can ensure that your extension won't be run in an earlier browser version. 956 </dd> 957 958 <!-- OBJECT PROPERTIES --> 959 <dd style="display: none; "> 960 <dl> 961 <div> 962 <div> 963 </div> 964 </div> 965 </dl> 966 </dd> 967 968 <!-- OBJECT METHODS --> 969 <dd style="display: none; "> 970 <div></div> 971 </dd> 972 973 <!-- OBJECT EVENT FIELDS --> 974 <dd style="display: none; "> 975 <div></div> 976 </dd> 977 978 <!-- FUNCTION PARAMETERS --> 979 <dd style="display: none; "> 980 <div></div> 981 </dd> 982 983 </div> 984 </div><div> 985 <div> 986 <dt> 987 <var>locale</var> 988 <em> 989 990 <!-- TYPE --> 991 <div style="display:inline"> 992 ( 993 <span class="optional">optional</span> 994 <span class="enum" style="display: none; ">enumerated</span> 995 <span id="typeTemplate"> 996 <span style="display: none; "> 997 <a> Type</a> 998 </span> 999 <span> 1000 <span style="display: none; "> 1001 array of <span><span></span></span> 1002 </span> 1003 <span>string</span> 1004 <span style="display: none; "></span> 1005 </span> 1006 </span> 1007 ) 1008 </div> 1009 1010 </em> 1011 </dt> 1012 <dd class="todo" style="display: none; "> 1013 Undocumented. 1014 </dd> 1015 <dd>The language and optional region code that specify the language and dialect to be used for synthesis, in the form <language>-<region>. Examples: 'en', 'en-US', 'en-GB', 'zh-CN', etc.</dd> 1016 <dd style="display: none; "> 1017 This parameter was added in version 1018 <b><span></span></b>. 1019 You must omit this parameter in earlier versions, 1020 and you may omit it in any version. If you require this 1021 parameter, the manifest key 1022 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1023 can ensure that your extension won't be run in an earlier browser version. 1024 </dd> 1025 1026 <!-- OBJECT PROPERTIES --> 1027 <dd style="display: none; "> 1028 <dl> 1029 <div> 1030 <div> 1031 </div> 1032 </div> 1033 </dl> 1034 </dd> 1035 1036 <!-- OBJECT METHODS --> 1037 <dd style="display: none; "> 1038 <div></div> 1039 </dd> 1040 1041 <!-- OBJECT EVENT FIELDS --> 1042 <dd style="display: none; "> 1043 <div></div> 1044 </dd> 1045 1046 <!-- FUNCTION PARAMETERS --> 1047 <dd style="display: none; "> 1048 <div></div> 1049 </dd> 1050 1051 </div> 1052 </div><div> 1053 <div> 1054 <dt> 1055 <var>gender</var> 1056 <em> 1057 1058 <!-- TYPE --> 1059 <div style="display:inline"> 1060 ( 1061 <span class="optional">optional</span> 1062 <span class="enum">enumerated</span> 1063 <span id="typeTemplate"> 1064 <span style="display: none; "> 1065 <a> Type</a> 1066 </span> 1067 <span> 1068 <span style="display: none; "> 1069 array of <span><span></span></span> 1070 </span> 1071 <span>string</span> 1072 <span>["male", "female"]</span> 1073 </span> 1074 </span> 1075 ) 1076 </div> 1077 1078 </em> 1079 </dt> 1080 <dd class="todo" style="display: none; "> 1081 Undocumented. 1082 </dd> 1083 <dd>Gender of voice for synthesized speech.</dd> 1084 <dd style="display: none; "> 1085 This parameter was added in version 1086 <b><span></span></b>. 1087 You must omit this parameter in earlier versions, 1088 and you may omit it in any version. If you require this 1089 parameter, the manifest key 1090 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1091 can ensure that your extension won't be run in an earlier browser version. 1092 </dd> 1093 1094 <!-- OBJECT PROPERTIES --> 1095 <dd style="display: none; "> 1096 <dl> 1097 <div> 1098 <div> 1099 </div> 1100 </div> 1101 </dl> 1102 </dd> 1103 1104 <!-- OBJECT METHODS --> 1105 <dd style="display: none; "> 1106 <div></div> 1107 </dd> 1108 1109 <!-- OBJECT EVENT FIELDS --> 1110 <dd style="display: none; "> 1111 <div></div> 1112 </dd> 1113 1114 <!-- FUNCTION PARAMETERS --> 1115 <dd style="display: none; "> 1116 <div></div> 1117 </dd> 1118 1119 </div> 1120 </div><div> 1121 <div> 1122 <dt> 1123 <var>rate</var> 1124 <em> 1125 1126 <!-- TYPE --> 1127 <div style="display:inline"> 1128 ( 1129 <span class="optional">optional</span> 1130 <span class="enum" style="display: none; ">enumerated</span> 1131 <span id="typeTemplate"> 1132 <span style="display: none; "> 1133 <a> Type</a> 1134 </span> 1135 <span> 1136 <span style="display: none; "> 1137 array of <span><span></span></span> 1138 </span> 1139 <span>number</span> 1140 <span style="display: none; "></span> 1141 </span> 1142 </span> 1143 ) 1144 </div> 1145 1146 </em> 1147 </dt> 1148 <dd class="todo" style="display: none; "> 1149 Undocumented. 1150 </dd> 1151 <dd>Speaking speed between 0 and 1 inclusive, with 0 being slowest and 1 being fastest, with a default of 0.5.</dd> 1152 <dd style="display: none; "> 1153 This parameter was added in version 1154 <b><span></span></b>. 1155 You must omit this parameter in earlier versions, 1156 and you may omit it in any version. If you require this 1157 parameter, the manifest key 1158 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1159 can ensure that your extension won't be run in an earlier browser version. 1160 </dd> 1161 1162 <!-- OBJECT PROPERTIES --> 1163 <dd style="display: none; "> 1164 <dl> 1165 <div> 1166 <div> 1167 </div> 1168 </div> 1169 </dl> 1170 </dd> 1171 1172 <!-- OBJECT METHODS --> 1173 <dd style="display: none; "> 1174 <div></div> 1175 </dd> 1176 1177 <!-- OBJECT EVENT FIELDS --> 1178 <dd style="display: none; "> 1179 <div></div> 1180 </dd> 1181 1182 <!-- FUNCTION PARAMETERS --> 1183 <dd style="display: none; "> 1184 <div></div> 1185 </dd> 1186 1187 </div> 1188 </div><div> 1189 <div> 1190 <dt> 1191 <var>pitch</var> 1192 <em> 1193 1194 <!-- TYPE --> 1195 <div style="display:inline"> 1196 ( 1197 <span class="optional">optional</span> 1198 <span class="enum" style="display: none; ">enumerated</span> 1199 <span id="typeTemplate"> 1200 <span style="display: none; "> 1201 <a> Type</a> 1202 </span> 1203 <span> 1204 <span style="display: none; "> 1205 array of <span><span></span></span> 1206 </span> 1207 <span>number</span> 1208 <span style="display: none; "></span> 1209 </span> 1210 </span> 1211 ) 1212 </div> 1213 1214 </em> 1215 </dt> 1216 <dd class="todo" style="display: none; "> 1217 Undocumented. 1218 </dd> 1219 <dd>Speaking pitch between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 0.5.</dd> 1220 <dd style="display: none; "> 1221 This parameter was added in version 1222 <b><span></span></b>. 1223 You must omit this parameter in earlier versions, 1224 and you may omit it in any version. If you require this 1225 parameter, the manifest key 1226 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1227 can ensure that your extension won't be run in an earlier browser version. 1228 </dd> 1229 1230 <!-- OBJECT PROPERTIES --> 1231 <dd style="display: none; "> 1232 <dl> 1233 <div> 1234 <div> 1235 </div> 1236 </div> 1237 </dl> 1238 </dd> 1239 1240 <!-- OBJECT METHODS --> 1241 <dd style="display: none; "> 1242 <div></div> 1243 </dd> 1244 1245 <!-- OBJECT EVENT FIELDS --> 1246 <dd style="display: none; "> 1247 <div></div> 1248 </dd> 1249 1250 <!-- FUNCTION PARAMETERS --> 1251 <dd style="display: none; "> 1252 <div></div> 1253 </dd> 1254 1255 </div> 1256 </div><div> 1257 <div> 1258 <dt> 1259 <var>volume</var> 1260 <em> 1261 1262 <!-- TYPE --> 1263 <div style="display:inline"> 1264 ( 1265 <span class="optional">optional</span> 1266 <span class="enum" style="display: none; ">enumerated</span> 1267 <span id="typeTemplate"> 1268 <span style="display: none; "> 1269 <a> Type</a> 1270 </span> 1271 <span> 1272 <span style="display: none; "> 1273 array of <span><span></span></span> 1274 </span> 1275 <span>number</span> 1276 <span style="display: none; "></span> 1277 </span> 1278 </span> 1279 ) 1280 </div> 1281 1282 </em> 1283 </dt> 1284 <dd class="todo" style="display: none; "> 1285 Undocumented. 1286 </dd> 1287 <dd>Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest, with a default of 1.0.</dd> 1288 <dd style="display: none; "> 1289 This parameter was added in version 1290 <b><span></span></b>. 1291 You must omit this parameter in earlier versions, 1292 and you may omit it in any version. If you require this 1293 parameter, the manifest key 1294 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1295 can ensure that your extension won't be run in an earlier browser version. 1296 </dd> 1297 1298 <!-- OBJECT PROPERTIES --> 1299 <dd style="display: none; "> 1300 <dl> 1301 <div> 1302 <div> 1303 </div> 1304 </div> 1305 </dl> 1306 </dd> 1307 1308 <!-- OBJECT METHODS --> 1309 <dd style="display: none; "> 1310 <div></div> 1311 </dd> 1312 1313 <!-- OBJECT EVENT FIELDS --> 1314 <dd style="display: none; "> 1315 <div></div> 1316 </dd> 1317 1318 <!-- FUNCTION PARAMETERS --> 1319 <dd style="display: none; "> 1320 <div></div> 1321 </dd> 1322 1323 </div> 1324 </div> 1325 </dl> 1326 </dd> 1327 1328 <!-- OBJECT METHODS --> 1329 <dd style="display: none; "> 1330 <div></div> 1331 </dd> 1332 1333 <!-- OBJECT EVENT FIELDS --> 1334 <dd style="display: none; "> 1335 <div></div> 1336 </dd> 1337 1338 <!-- FUNCTION PARAMETERS --> 1339 <dd style="display: none; "> 1340 <div></div> 1341 </dd> 1342 1343 </div> 1344 </div><div> 1345 <div> 1346 <dt> 1347 <var>callback</var> 1348 <em> 1349 1350 <!-- TYPE --> 1351 <div style="display:inline"> 1352 ( 1353 <span class="optional">optional</span> 1354 <span class="enum" style="display: none; ">enumerated</span> 1355 <span id="typeTemplate"> 1356 <span style="display: none; "> 1357 <a> Type</a> 1358 </span> 1359 <span> 1360 <span style="display: none; "> 1361 array of <span><span></span></span> 1362 </span> 1363 <span>function</span> 1364 <span style="display: none; "></span> 1365 </span> 1366 </span> 1367 ) 1368 </div> 1369 1370 </em> 1371 </dt> 1372 <dd class="todo" style="display: none; "> 1373 Undocumented. 1374 </dd> 1375 <dd>This function is called when speaking is finished.</dd> 1376 <dd style="display: none; "> 1377 This parameter was added in version 1378 <b><span></span></b>. 1379 You must omit this parameter in earlier versions, 1380 and you may omit it in any version. If you require this 1381 parameter, the manifest key 1382 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1383 can ensure that your extension won't be run in an earlier browser version. 1384 </dd> 1385 1386 <!-- OBJECT PROPERTIES --> 1387 <dd style="display: none; "> 1388 <dl> 1389 <div> 1390 <div> 1391 </div> 1392 </div> 1393 </dl> 1394 </dd> 1395 1396 <!-- OBJECT METHODS --> 1397 <dd style="display: none; "> 1398 <div></div> 1399 </dd> 1400 1401 <!-- OBJECT EVENT FIELDS --> 1402 <dd style="display: none; "> 1403 <div></div> 1404 </dd> 1405 1406 <!-- FUNCTION PARAMETERS --> 1407 <dd style="display: none; "> 1408 <div></div> 1409 </dd> 1410 1411 </div> 1412 </div> 1413 </dl> 1414 1415 <!-- RETURNS --> 1416 <h4 style="display: none; ">Returns</h4> 1417 <dl> 1418 <div style="display: none; "> 1419 <div> 1420 </div> 1421 </div> 1422 </dl> 1423 1424 <!-- CALLBACK --> 1425 <div> 1426 <div> 1427 <h4>Callback function</h4> 1428 <p style="display: none; "> 1429 The callback <em>parameter</em> should specify a function 1430 that looks like this: 1431 </p> 1432 <p> 1433 If you specify the <em>callback</em> parameter, it should 1434 specify a function that looks like this: 1435 </p> 1436 1437 <!-- Note: intentionally longer 80 columns --> 1438 <pre>function(<span></span>) <span class="subdued">{...}</span>;</pre> 1439 <dl> 1440 <div style="display: none; "> 1441 <div> 1442 </div> 1443 </div> 1444 </dl> 1445 </div> 1446 </div> 1447 1448 <!-- MIN_VERSION --> 1449 <p style="display: none; "> 1450 This function was added in version <b><span></span></b>. 1451 If you require this function, the manifest key 1452 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1453 can ensure that your extension won't be run in an earlier browser version. 1454 </p> 1455 </div> <!-- /description --> 1456 1457 </div><div class="apiItem" style="display: none; "> 1458 <a></a> <!-- method-anchor --> 1459 <h4>method name</h4> 1460 1461 <div class="summary"><span>void</span> 1462 <!-- Note: intentionally longer 80 columns --> 1463 <span>chrome.module.methodName</span>(<span><span>, </span><span></span> 1464 <var><span></span></var></span>)</div> 1465 1466 <div class="description"> 1467 <p class="todo">Undocumented.</p> 1468 <p> 1469 A description from the json schema def of the function goes here. 1470 </p> 1471 1472 <!-- PARAMETERS --> 1473 <h4>Parameters</h4> 1474 <dl> 1475 <div> 1476 <div> 1477 </div> 1478 </div> 1479 </dl> 1480 1481 <!-- RETURNS --> 1482 <h4>Returns</h4> 1483 <dl> 1484 <div> 1485 <div> 1486 </div> 1487 </div> 1488 </dl> 1489 1490 <!-- CALLBACK --> 1491 <div> 1492 <div> 1493 <h4>Callback function</h4> 1494 <p> 1495 The callback <em>parameter</em> should specify a function 1496 that looks like this: 1497 </p> 1498 <p> 1499 If you specify the <em>callback</em> parameter, it should 1500 specify a function that looks like this: 1501 </p> 1502 1503 <!-- Note: intentionally longer 80 columns --> 1504 <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>;</pre> 1505 <dl> 1506 <div> 1507 <div> 1508 </div> 1509 </div> 1510 </dl> 1511 </div> 1512 </div> 1513 1514 <!-- MIN_VERSION --> 1515 <p> 1516 This function was added in version <b><span></span></b>. 1517 If you require this function, the manifest key 1518 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1519 can ensure that your extension won't be run in an earlier browser version. 1520 </p> 1521 </div> <!-- /description --> 1522 1523 </div><div class="apiItem"> 1524 <a name="method-stop"></a> <!-- method-anchor --> 1525 <h4>stop</h4> 1526 1527 <div class="summary"><span style="display: none; ">void</span> 1528 <!-- Note: intentionally longer 80 columns --> 1529 <span>chrome.experimental.tts.stop</span>(<span style="display: none; "><span>, </span><span></span> 1530 <var><span></span></var></span>)</div> 1531 1532 <div class="description"> 1533 <p class="todo" style="display: none; ">Undocumented.</p> 1534 <p>Stop any current speech.</p> 1535 1536 <!-- PARAMETERS --> 1537 <h4 style="display: none; ">Parameters</h4> 1538 <dl> 1539 <div style="display: none; "> 1540 <div> 1541 </div> 1542 </div> 1543 </dl> 1544 1545 <!-- RETURNS --> 1546 <h4 style="display: none; ">Returns</h4> 1547 <dl> 1548 <div style="display: none; "> 1549 <div> 1550 </div> 1551 </div> 1552 </dl> 1553 1554 <!-- CALLBACK --> 1555 <div style="display: none; "> 1556 <div> 1557 <h4>Callback function</h4> 1558 <p> 1559 The callback <em>parameter</em> should specify a function 1560 that looks like this: 1561 </p> 1562 <p> 1563 If you specify the <em>callback</em> parameter, it should 1564 specify a function that looks like this: 1565 </p> 1566 1567 <!-- Note: intentionally longer 80 columns --> 1568 <pre>function(<span>Type param1, Type param2</span>) <span class="subdued">{...}</span>;</pre> 1569 <dl> 1570 <div> 1571 <div> 1572 </div> 1573 </div> 1574 </dl> 1575 </div> 1576 </div> 1577 1578 <!-- MIN_VERSION --> 1579 <p style="display: none; "> 1580 This function was added in version <b><span></span></b>. 1581 If you require this function, the manifest key 1582 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1583 can ensure that your extension won't be run in an earlier browser version. 1584 </p> 1585 </div> <!-- /description --> 1586 1587 </div> <!-- /apiItem --> 1588 1589 </div> <!-- /apiGroup --> 1590 1591 <!-- EVENTS --> 1592 <div id="eventsTemplate" class="apiGroup"> 1593 <a name="global-events"></a> 1594 <h3>Events</h3> 1595 <!-- iterates over all events --> 1596 <div class="apiItem"> 1597 <a name="event-onSpeak"></a> 1598 <h4>onSpeak</h4> 1599 1600 <div class="summary"> 1601 <!-- Note: intentionally longer 80 columns --> 1602 <span class="subdued">chrome.experimental.tts.</span><span>onSpeak</span><span class="subdued">.addListener</span>(function(<span>string utterance, object options, function callback</span>) <span class="subdued">{...}</span>); 1603 </div> 1604 1605 <div class="description"> 1606 <p class="todo" style="display: none; ">Undocumented.</p> 1607 <p>Called when the user makes a call to tts.speak and the options matches one of the tts_voices from this extension's manifest.</p> 1608 1609 <!-- PARAMETERS --> 1610 <div> 1611 <h4>Parameters</h4> 1612 <dl> 1613 <div> 1614 <div> 1615 <dt> 1616 <var>utterance</var> 1617 <em> 1618 1619 <!-- TYPE --> 1620 <div style="display:inline"> 1621 ( 1622 <span class="optional" style="display: none; ">optional</span> 1623 <span class="enum" style="display: none; ">enumerated</span> 1624 <span id="typeTemplate"> 1625 <span style="display: none; "> 1626 <a> Type</a> 1627 </span> 1628 <span> 1629 <span style="display: none; "> 1630 array of <span><span></span></span> 1631 </span> 1632 <span>string</span> 1633 <span style="display: none; "></span> 1634 </span> 1635 </span> 1636 ) 1637 </div> 1638 1639 </em> 1640 </dt> 1641 <dd class="todo" style="display: none; "> 1642 Undocumented. 1643 </dd> 1644 <dd>The text to speak. This may include SSML, so if your engine does not support SSML, you should strip out all XML markup and synthesize only the underlying text content.</dd> 1645 <dd style="display: none; "> 1646 This parameter was added in version 1647 <b><span></span></b>. 1648 You must omit this parameter in earlier versions, 1649 and you may omit it in any version. If you require this 1650 parameter, the manifest key 1651 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1652 can ensure that your extension won't be run in an earlier browser version. 1653 </dd> 1654 1655 <!-- OBJECT PROPERTIES --> 1656 <dd style="display: none; "> 1657 <dl> 1658 <div> 1659 <div> 1660 </div> 1661 </div> 1662 </dl> 1663 </dd> 1664 1665 <!-- OBJECT METHODS --> 1666 <dd style="display: none; "> 1667 <div></div> 1668 </dd> 1669 1670 <!-- OBJECT EVENT FIELDS --> 1671 <dd style="display: none; "> 1672 <div></div> 1673 </dd> 1674 1675 <!-- FUNCTION PARAMETERS --> 1676 <dd style="display: none; "> 1677 <div></div> 1678 </dd> 1679 1680 </div> 1681 </div><div> 1682 <div> 1683 <dt> 1684 <var>options</var> 1685 <em> 1686 1687 <!-- TYPE --> 1688 <div style="display:inline"> 1689 ( 1690 <span class="optional" style="display: none; ">optional</span> 1691 <span class="enum" style="display: none; ">enumerated</span> 1692 <span id="typeTemplate"> 1693 <span style="display: none; "> 1694 <a> Type</a> 1695 </span> 1696 <span> 1697 <span style="display: none; "> 1698 array of <span><span></span></span> 1699 </span> 1700 <span>object</span> 1701 <span style="display: none; "></span> 1702 </span> 1703 </span> 1704 ) 1705 </div> 1706 1707 </em> 1708 </dt> 1709 <dd class="todo" style="display: none; "> 1710 Undocumented. 1711 </dd> 1712 <dd>The speak options.</dd> 1713 <dd style="display: none; "> 1714 This parameter was added in version 1715 <b><span></span></b>. 1716 You must omit this parameter in earlier versions, 1717 and you may omit it in any version. If you require this 1718 parameter, the manifest key 1719 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1720 can ensure that your extension won't be run in an earlier browser version. 1721 </dd> 1722 1723 <!-- OBJECT PROPERTIES --> 1724 <dd> 1725 <dl> 1726 <div> 1727 <div> 1728 <dt> 1729 <var>voiceName</var> 1730 <em> 1731 1732 <!-- TYPE --> 1733 <div style="display:inline"> 1734 ( 1735 <span class="optional">optional</span> 1736 <span class="enum" style="display: none; ">enumerated</span> 1737 <span id="typeTemplate"> 1738 <span style="display: none; "> 1739 <a> Type</a> 1740 </span> 1741 <span> 1742 <span style="display: none; "> 1743 array of <span><span></span></span> 1744 </span> 1745 <span>string</span> 1746 <span style="display: none; "></span> 1747 </span> 1748 </span> 1749 ) 1750 </div> 1751 1752 </em> 1753 </dt> 1754 <dd class="todo" style="display: none; "> 1755 Undocumented. 1756 </dd> 1757 <dd>The name of the voice to use for synthesis.</dd> 1758 <dd style="display: none; "> 1759 This parameter was added in version 1760 <b><span></span></b>. 1761 You must omit this parameter in earlier versions, 1762 and you may omit it in any version. If you require this 1763 parameter, the manifest key 1764 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1765 can ensure that your extension won't be run in an earlier browser version. 1766 </dd> 1767 1768 <!-- OBJECT PROPERTIES --> 1769 <dd style="display: none; "> 1770 <dl> 1771 <div> 1772 <div> 1773 </div> 1774 </div> 1775 </dl> 1776 </dd> 1777 1778 <!-- OBJECT METHODS --> 1779 <dd style="display: none; "> 1780 <div></div> 1781 </dd> 1782 1783 <!-- OBJECT EVENT FIELDS --> 1784 <dd style="display: none; "> 1785 <div></div> 1786 </dd> 1787 1788 <!-- FUNCTION PARAMETERS --> 1789 <dd style="display: none; "> 1790 <div></div> 1791 </dd> 1792 1793 </div> 1794 </div><div> 1795 <div> 1796 <dt> 1797 <var>locale</var> 1798 <em> 1799 1800 <!-- TYPE --> 1801 <div style="display:inline"> 1802 ( 1803 <span class="optional">optional</span> 1804 <span class="enum" style="display: none; ">enumerated</span> 1805 <span id="typeTemplate"> 1806 <span style="display: none; "> 1807 <a> Type</a> 1808 </span> 1809 <span> 1810 <span style="display: none; "> 1811 array of <span><span></span></span> 1812 </span> 1813 <span>string</span> 1814 <span style="display: none; "></span> 1815 </span> 1816 </span> 1817 ) 1818 </div> 1819 1820 </em> 1821 </dt> 1822 <dd class="todo" style="display: none; "> 1823 Undocumented. 1824 </dd> 1825 <dd>The language and region code that specify the language and dialect to be used for synthesis, in the form <language>-<region>, e.g. en-US, en-GB, fr-CA, zh-CN, etc.</region></language></dd> 1826 <dd style="display: none; "> 1827 This parameter was added in version 1828 <b><span></span></b>. 1829 You must omit this parameter in earlier versions, 1830 and you may omit it in any version. If you require this 1831 parameter, the manifest key 1832 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1833 can ensure that your extension won't be run in an earlier browser version. 1834 </dd> 1835 1836 <!-- OBJECT PROPERTIES --> 1837 <dd style="display: none; "> 1838 <dl> 1839 <div> 1840 <div> 1841 </div> 1842 </div> 1843 </dl> 1844 </dd> 1845 1846 <!-- OBJECT METHODS --> 1847 <dd style="display: none; "> 1848 <div></div> 1849 </dd> 1850 1851 <!-- OBJECT EVENT FIELDS --> 1852 <dd style="display: none; "> 1853 <div></div> 1854 </dd> 1855 1856 <!-- FUNCTION PARAMETERS --> 1857 <dd style="display: none; "> 1858 <div></div> 1859 </dd> 1860 1861 </div> 1862 </div><div> 1863 <div> 1864 <dt> 1865 <var>gender</var> 1866 <em> 1867 1868 <!-- TYPE --> 1869 <div style="display:inline"> 1870 ( 1871 <span class="optional">optional</span> 1872 <span class="enum">enumerated</span> 1873 <span id="typeTemplate"> 1874 <span style="display: none; "> 1875 <a> Type</a> 1876 </span> 1877 <span> 1878 <span style="display: none; "> 1879 array of <span><span></span></span> 1880 </span> 1881 <span>string</span> 1882 <span>["male", "female"]</span> 1883 </span> 1884 </span> 1885 ) 1886 </div> 1887 1888 </em> 1889 </dt> 1890 <dd class="todo" style="display: none; "> 1891 Undocumented. 1892 </dd> 1893 <dd>Gender of voice for synthesized speech.</dd> 1894 <dd style="display: none; "> 1895 This parameter was added in version 1896 <b><span></span></b>. 1897 You must omit this parameter in earlier versions, 1898 and you may omit it in any version. If you require this 1899 parameter, the manifest key 1900 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1901 can ensure that your extension won't be run in an earlier browser version. 1902 </dd> 1903 1904 <!-- OBJECT PROPERTIES --> 1905 <dd style="display: none; "> 1906 <dl> 1907 <div> 1908 <div> 1909 </div> 1910 </div> 1911 </dl> 1912 </dd> 1913 1914 <!-- OBJECT METHODS --> 1915 <dd style="display: none; "> 1916 <div></div> 1917 </dd> 1918 1919 <!-- OBJECT EVENT FIELDS --> 1920 <dd style="display: none; "> 1921 <div></div> 1922 </dd> 1923 1924 <!-- FUNCTION PARAMETERS --> 1925 <dd style="display: none; "> 1926 <div></div> 1927 </dd> 1928 1929 </div> 1930 </div><div> 1931 <div> 1932 <dt> 1933 <var>rate</var> 1934 <em> 1935 1936 <!-- TYPE --> 1937 <div style="display:inline"> 1938 ( 1939 <span class="optional">optional</span> 1940 <span class="enum" style="display: none; ">enumerated</span> 1941 <span id="typeTemplate"> 1942 <span style="display: none; "> 1943 <a> Type</a> 1944 </span> 1945 <span> 1946 <span style="display: none; "> 1947 array of <span><span></span></span> 1948 </span> 1949 <span>number</span> 1950 <span style="display: none; "></span> 1951 </span> 1952 </span> 1953 ) 1954 </div> 1955 1956 </em> 1957 </dt> 1958 <dd class="todo" style="display: none; "> 1959 Undocumented. 1960 </dd> 1961 <dd>Speaking speed between 0 and 1 inclusive, with 0 being slowest and 1 being fastest.</dd> 1962 <dd style="display: none; "> 1963 This parameter was added in version 1964 <b><span></span></b>. 1965 You must omit this parameter in earlier versions, 1966 and you may omit it in any version. If you require this 1967 parameter, the manifest key 1968 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 1969 can ensure that your extension won't be run in an earlier browser version. 1970 </dd> 1971 1972 <!-- OBJECT PROPERTIES --> 1973 <dd style="display: none; "> 1974 <dl> 1975 <div> 1976 <div> 1977 </div> 1978 </div> 1979 </dl> 1980 </dd> 1981 1982 <!-- OBJECT METHODS --> 1983 <dd style="display: none; "> 1984 <div></div> 1985 </dd> 1986 1987 <!-- OBJECT EVENT FIELDS --> 1988 <dd style="display: none; "> 1989 <div></div> 1990 </dd> 1991 1992 <!-- FUNCTION PARAMETERS --> 1993 <dd style="display: none; "> 1994 <div></div> 1995 </dd> 1996 1997 </div> 1998 </div><div> 1999 <div> 2000 <dt> 2001 <var>pitch</var> 2002 <em> 2003 2004 <!-- TYPE --> 2005 <div style="display:inline"> 2006 ( 2007 <span class="optional">optional</span> 2008 <span class="enum" style="display: none; ">enumerated</span> 2009 <span id="typeTemplate"> 2010 <span style="display: none; "> 2011 <a> Type</a> 2012 </span> 2013 <span> 2014 <span style="display: none; "> 2015 array of <span><span></span></span> 2016 </span> 2017 <span>number</span> 2018 <span style="display: none; "></span> 2019 </span> 2020 </span> 2021 ) 2022 </div> 2023 2024 </em> 2025 </dt> 2026 <dd class="todo" style="display: none; "> 2027 Undocumented. 2028 </dd> 2029 <dd>Speaking pitch between 0 and 1 inclusive, with 0 being lowest and 1 being highest.</dd> 2030 <dd style="display: none; "> 2031 This parameter was added in version 2032 <b><span></span></b>. 2033 You must omit this parameter in earlier versions, 2034 and you may omit it in any version. If you require this 2035 parameter, the manifest key 2036 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2037 can ensure that your extension won't be run in an earlier browser version. 2038 </dd> 2039 2040 <!-- OBJECT PROPERTIES --> 2041 <dd style="display: none; "> 2042 <dl> 2043 <div> 2044 <div> 2045 </div> 2046 </div> 2047 </dl> 2048 </dd> 2049 2050 <!-- OBJECT METHODS --> 2051 <dd style="display: none; "> 2052 <div></div> 2053 </dd> 2054 2055 <!-- OBJECT EVENT FIELDS --> 2056 <dd style="display: none; "> 2057 <div></div> 2058 </dd> 2059 2060 <!-- FUNCTION PARAMETERS --> 2061 <dd style="display: none; "> 2062 <div></div> 2063 </dd> 2064 2065 </div> 2066 </div><div> 2067 <div> 2068 <dt> 2069 <var>volume</var> 2070 <em> 2071 2072 <!-- TYPE --> 2073 <div style="display:inline"> 2074 ( 2075 <span class="optional">optional</span> 2076 <span class="enum" style="display: none; ">enumerated</span> 2077 <span id="typeTemplate"> 2078 <span style="display: none; "> 2079 <a> Type</a> 2080 </span> 2081 <span> 2082 <span style="display: none; "> 2083 array of <span><span></span></span> 2084 </span> 2085 <span>number</span> 2086 <span style="display: none; "></span> 2087 </span> 2088 </span> 2089 ) 2090 </div> 2091 2092 </em> 2093 </dt> 2094 <dd class="todo" style="display: none; "> 2095 Undocumented. 2096 </dd> 2097 <dd>Speaking volume between 0 and 1 inclusive, with 0 being lowest and 1 being highest.</dd> 2098 <dd style="display: none; "> 2099 This parameter was added in version 2100 <b><span></span></b>. 2101 You must omit this parameter in earlier versions, 2102 and you may omit it in any version. If you require this 2103 parameter, the manifest key 2104 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2105 can ensure that your extension won't be run in an earlier browser version. 2106 </dd> 2107 2108 <!-- OBJECT PROPERTIES --> 2109 <dd style="display: none; "> 2110 <dl> 2111 <div> 2112 <div> 2113 </div> 2114 </div> 2115 </dl> 2116 </dd> 2117 2118 <!-- OBJECT METHODS --> 2119 <dd style="display: none; "> 2120 <div></div> 2121 </dd> 2122 2123 <!-- OBJECT EVENT FIELDS --> 2124 <dd style="display: none; "> 2125 <div></div> 2126 </dd> 2127 2128 <!-- FUNCTION PARAMETERS --> 2129 <dd style="display: none; "> 2130 <div></div> 2131 </dd> 2132 2133 </div> 2134 </div> 2135 </dl> 2136 </dd> 2137 2138 <!-- OBJECT METHODS --> 2139 <dd style="display: none; "> 2140 <div></div> 2141 </dd> 2142 2143 <!-- OBJECT EVENT FIELDS --> 2144 <dd style="display: none; "> 2145 <div></div> 2146 </dd> 2147 2148 <!-- FUNCTION PARAMETERS --> 2149 <dd style="display: none; "> 2150 <div></div> 2151 </dd> 2152 2153 </div> 2154 </div><div> 2155 <div> 2156 <dt> 2157 <var>callback</var> 2158 <em> 2159 2160 <!-- TYPE --> 2161 <div style="display:inline"> 2162 ( 2163 <span class="optional" style="display: none; ">optional</span> 2164 <span class="enum" style="display: none; ">enumerated</span> 2165 <span id="typeTemplate"> 2166 <span style="display: none; "> 2167 <a> Type</a> 2168 </span> 2169 <span> 2170 <span style="display: none; "> 2171 array of <span><span></span></span> 2172 </span> 2173 <span>function</span> 2174 <span style="display: none; "></span> 2175 </span> 2176 </span> 2177 ) 2178 </div> 2179 2180 </em> 2181 </dt> 2182 <dd class="todo" style="display: none; "> 2183 Undocumented. 2184 </dd> 2185 <dd>You must call this function when speaking is finished.</dd> 2186 <dd style="display: none; "> 2187 This parameter was added in version 2188 <b><span></span></b>. 2189 You must omit this parameter in earlier versions, 2190 and you may omit it in any version. If you require this 2191 parameter, the manifest key 2192 <a href="manifest.html#minimum_chrome_version">minimum_chrome_version</a> 2193 can ensure that your extension won't be run in an earlier browser version. 2194 </dd> 2195 2196 <!-- OBJECT PROPERTIES --> 2197 <dd style="display: none; "> 2198 <dl> 2199 <div> 2200 <div> 2201 </div> 2202 </div> 2203 </dl> 2204 </dd> 2205 2206 <!-- OBJECT METHODS --> 2207 <dd style="display: none; "> 2208 <div></div> 2209 </dd> 2210 2211 <!-- OBJECT EVENT FIELDS --> 2212 <dd style="display: none; "> 2213 <div></div> 2214 </dd> 2215 2216 <!-- FUNCTION PARAMETERS --> 2217 <dd style="display: none; "> 2218 <div></div> 2219 </dd> 2220 2221 </div> 2222 </div> 2223 </dl> 2224 </div> 2225 </div> <!-- /decription --> 2226 2227 </div><div class="apiItem"> 2228 <a name="event-onStop"></a> 2229 <h4>onStop</h4> 2230 2231 <div class="summary"> 2232 <!-- Note: intentionally longer 80 columns --> 2233 <span class="subdued">chrome.experimental.tts.</span><span>onStop</span><span class="subdued">.addListener</span>(function(<span></span>) <span class="subdued">{...}</span>); 2234 </div> 2235 2236 <div class="description"> 2237 <p class="todo" style="display: none; ">Undocumented.</p> 2238 <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 speech is already stopped, it should do nothing (not raise an error).</p> 2239 2240 <!-- PARAMETERS --> 2241 <div style="display: none; "> 2242 <h4>Parameters</h4> 2243 <dl> 2244 <div> 2245 <div> 2246 </div> 2247 </div> 2248 </dl> 2249 </div> 2250 </div> <!-- /decription --> 2251 2252 </div> <!-- /apiItem --> 2253 2254 </div> <!-- /apiGroup --> 2255 2256 <!-- TYPES --> 2257 <div class="apiGroup" style="display: none; "> 2258 <a name="types"></a> 2259 <h3 id="types">Types</h3> 2260 2261 <!-- iterates over all types --> 2262 <div class="apiItem"> 2263 <a></a> 2264 <h4>type name</h4> 2265 2266 <div> 2267 </div> 2268 2269 </div> <!-- /apiItem --> 2270 2271 </div> <!-- /apiGroup --> 2272 2273 </div> <!-- /apiPage --> 2274 </div> <!-- /gc-pagecontent --> 2275 </div> <!-- /g-section --> 2276 </div> <!-- /codesiteContent --> 2277 <div id="gc-footer" --=""> 2278 <div class="text"> 2279 <p> 2280 Except as otherwise <a href="http://code.google.com/policies.html#restrictions">noted</a>, 2281 the content of this page is licensed under the <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons 2282 Attribution 3.0 License</a>, and code samples are licensed under the 2283 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD License</a>. 2284 </p> 2285 <p> 2286 2011 Google 2287 </p> 2288 2289 <!-- begin analytics --> 2290 <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script> 2291 <script src="http://www.google-analytics.com/ga.js" type="text/javascript"></script> 2292 2293 <script type="text/javascript"> 2294 // chrome doc tracking 2295 try { 2296 var engdocs = _gat._getTracker("YT-10763712-2"); 2297 engdocs._trackPageview(); 2298 } catch(err) {} 2299 2300 // code.google.com site-wide tracking 2301 try { 2302 _uacct="UA-18071-1"; 2303 _uanchor=1; 2304 _uff=0; 2305 urchinTracker(); 2306 } 2307 catch(e) {/* urchinTracker not available. */} 2308 </script> 2309 <!-- end analytics --> 2310 </div> 2311 </div> <!-- /gc-footer --> 2312 </div> <!-- /gc-container --> 2313 </body></html> 2314