| OLD | NEW |
| 1 <div id="pageData-name" class="pageData">Speech Input API</div> | |
| 2 | |
| 3 <!-- BEGIN AUTHORED CONTENT --> | |
| 4 <p id="classSummary"> | 1 <p id="classSummary"> |
| 5 The <code>chrome.experimental.speechInput</code> module provides | 2 The <code>chrome.experimental.speechInput</code> module provides |
| 6 one-shot speech recognition to Chrome extensions. | 3 one-shot speech recognition to Chrome extensions. |
| 7 This module is still experimental. For information on how to use experimental | 4 This module is still experimental. For information on how to use experimental |
| 8 APIs, see the <a href="experimental.html">chrome.experimental.* APIs</a> page. | 5 APIs, see the <a href="experimental.html">chrome.experimental.* APIs</a> page. |
| 9 </p> | 6 </p> |
| 10 | 7 |
| 11 <h2 id="manifest">Manifest</h2> | 8 <h2 id="manifest">Manifest</h2> |
| 12 <p>You must declare the "experimental" permission in the <a | 9 <p>You must declare the "experimental" permission in the <a |
| 13 href="manifest.html">extension manifest</a> to use the speech input | 10 href="manifest.html">extension manifest</a> to use the speech input |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 alert("Speech input failed: " + error.code); | 99 alert("Speech input failed: " + error.code); |
| 103 } | 100 } |
| 104 | 101 |
| 105 function recognitionSucceeded(result) { | 102 function recognitionSucceeded(result) { |
| 106 alert("Recognized '" + result.hypotheses[0].utterance + "' with confidence " +
result.hypotheses[0].confidence); | 103 alert("Recognized '" + result.hypotheses[0].utterance + "' with confidence " +
result.hypotheses[0].confidence); |
| 107 } | 104 } |
| 108 | 105 |
| 109 chrome.experimental.speechInput.onError.addListener(recognitionFailed); | 106 chrome.experimental.speechInput.onError.addListener(recognitionFailed); |
| 110 chrome.experimental.speechInput.onResult.addListener(recognitionSucceeded); | 107 chrome.experimental.speechInput.onResult.addListener(recognitionSucceeded); |
| 111 chrome.experimental.speechInput.start({ "language": "en" }, checkStart); | 108 chrome.experimental.speechInput.start({ "language": "en" }, checkStart); |
| 112 </pre> | 109 </pre> |
| OLD | NEW |