OLD | NEW |
1 <!-- BEGIN AUTHORED CONTENT --> | |
2 <p id="classSummary"> | 1 <p id="classSummary"> |
3 The <code>chrome.experimental.speechInput</code> module provides | 2 The <code>chrome.experimental.speechInput</code> module provides |
4 one-shot speech recognition to Chrome extensions. | 3 one-shot speech recognition to Chrome extensions. |
5 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 |
6 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. |
7 </p> | 6 </p> |
8 <h2 id="manifest">Manifest</h2> | 7 <h2 id="manifest">Manifest</h2> |
9 <p>You must declare the "experimental" permission in the <a | 8 <p>You must declare the "experimental" permission in the <a |
10 href="manifest.html">extension manifest</a> to use the speech input | 9 href="manifest.html">extension manifest</a> to use the speech input |
11 API. | 10 API. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 76 } |
78 function recognitionFailed(error) { | 77 function recognitionFailed(error) { |
79 alert("Speech input failed: " + error.code); | 78 alert("Speech input failed: " + error.code); |
80 } | 79 } |
81 function recognitionSucceeded(result) { | 80 function recognitionSucceeded(result) { |
82 alert("Recognized '" + result.hypotheses[0].utterance + "' with confidence " +
result.hypotheses[0].confidence); | 81 alert("Recognized '" + result.hypotheses[0].utterance + "' with confidence " +
result.hypotheses[0].confidence); |
83 } | 82 } |
84 chrome.experimental.speechInput.onError.addListener(recognitionFailed); | 83 chrome.experimental.speechInput.onError.addListener(recognitionFailed); |
85 chrome.experimental.speechInput.onResult.addListener(recognitionSucceeded); | 84 chrome.experimental.speechInput.onResult.addListener(recognitionSucceeded); |
86 chrome.experimental.speechInput.start({ "language": "en" }, checkStart); | 85 chrome.experimental.speechInput.start({ "language": "en" }, checkStart); |
87 </pre> | 86 </pre> |
OLD | NEW |