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