diff options
author | fangjue23303@gmail.com <fangjue23303@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 04:48:45 +0000 |
---|---|---|
committer | fangjue23303@gmail.com <fangjue23303@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-24 04:48:45 +0000 |
commit | 01764cd9734cf0bab1cbbb4d45a83801dd441a91 (patch) | |
tree | f12b73f54cffca61b6c7fe5b3a6742c9cff93d6d | |
parent | ad3eb044d150c1570ed5fea5b709ff508be0eb0c (diff) | |
download | chromium_src-01764cd9734cf0bab1cbbb4d45a83801dd441a91.zip chromium_src-01764cd9734cf0bab1cbbb4d45a83801dd441a91.tar.gz chromium_src-01764cd9734cf0bab1cbbb4d45a83801dd441a91.tar.bz2 |
Remove chrome.experimental.speechInput API docs and samples
BUG=230740
Review URL: https://chromiumcodereview.appspot.com/13925013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196025 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 0 insertions, 171 deletions
diff --git a/chrome/common/extensions/docs/examples/api/speechInput/basic/background.js b/chrome/common/extensions/docs/examples/api/speechInput/basic/background.js deleted file mode 100644 index bd9b99a..0000000 --- a/chrome/common/extensions/docs/examples/api/speechInput/basic/background.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -function setStartIcon() { - chrome.browserAction.setIcon({ path: "start.png" }); -} - -function setStopIcon() { - chrome.browserAction.setIcon({ path: "stop.png" }); -} - -chrome.browserAction.onClicked.addListener(function(tab) { - chrome.experimental.speechInput.isRecording(function(recording) { - if (!recording) { - chrome.experimental.speechInput.start({}, function() { - if (chrome.runtime.lastError) { - alert("Couldn't start speech input: " + - chrome.runtime.lastError.message); - setStartIcon(); - } else { - setStopIcon(); - } - }); - } else { - chrome.experimental.speechInput.stop(function() { - setStartIcon(); - }); - } - }); -}); - -chrome.experimental.speechInput.onError.addListener(function(error) { - alert("Speech input failed: " + error.code); - setStartIcon(); -}); - -chrome.experimental.speechInput.onResult.addListener(function(result) { - alert(result.hypotheses[0].utterance); - setStartIcon(); -}); diff --git a/chrome/common/extensions/docs/examples/api/speechInput/basic/manifest.json b/chrome/common/extensions/docs/examples/api/speechInput/basic/manifest.json deleted file mode 100644 index f7e8f03..0000000 --- a/chrome/common/extensions/docs/examples/api/speechInput/basic/manifest.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "Speech Recognizer", - "version": "1.1", - "description": "Recognizes your speech and tells you the most likely result.", - - "browser_action": { - "default_title": "Speech Recognizer", - "default_icon": "start.png" - }, - - "background": { - "persistent": false, - "scripts": ["background.js"] - }, - - "permissions": [ - "experimental" - ], - "manifest_version": 2 -} diff --git a/chrome/common/extensions/docs/templates/intros/experimental_speechInput.html b/chrome/common/extensions/docs/templates/intros/experimental_speechInput.html deleted file mode 100644 index 1db1334..0000000 --- a/chrome/common/extensions/docs/templates/intros/experimental_speechInput.html +++ /dev/null @@ -1,109 +0,0 @@ -<p id="classSummary"> -The <code>chrome.experimental.speechInput</code> module provides -one-shot speech recognition to Chrome extensions. -This module is still experimental. For information on how to use experimental -APIs, see the <a href="experimental.html">chrome.experimental.* APIs</a> page. -</p> - -<h2 id="manifest">Manifest</h2> -<p>You must declare the "experimental" permission in the <a - href="manifest.html">extension manifest</a> to use the speech input -API. -For example:</p> -<pre>{ - "name": "My extension", - ... - <b>"permissions": [ - "experimental" - ]</b>, - ... -}</pre> - -<h2 id="howToStart">How to start speech recognition</h2> -<p>To start recognizing speech an extension must call the <code>start()</code> -method. If provided, your callback will be called once recording has -successfully started. In case of error <code>chrome.runtime.lastError</code> -will be set.</p> - -<p>This API provides exclusive access to the default recording device to the -first extension requesting it. Consequently, any calls to <code>start()</code> -when the device is being used by another extension or web page will fail and set -<code>chrome.runtime.lastError</code>. The message <code>requestDenied</code> -will be set if another extension in the same profile is making use of the API. -Otherwise <code>noRecordingDeviceFound</code>, <code>recordingDeviceInUse</code> -or <code>unableToStart</code> will be set depending on the situation.</p> - -<p>To check whether recording is currently active, call the -<code>isRecording()</code> method. Please note that it only checks for audio -recording within Chrome.</p> - - -<h2 id="howToGetResults">How to get speech recognition results</h2> -<p>Listen to the <code>onResult</code> event to receive speech recognition -results.</p> - -<pre> -var callback = function(result) { ... }; - -chrome.experimental.speechInput.onResult.addListener(callback); -</pre> - -<p>The <code>result</code> object contains an array of -$ref:experimental.speechInput.SpeechInputResultHypothesis -sorted by decreasing likelihood.</p> - -<p>Recording automatically stops when results are received. It is safe to call -<code>start()</code> again from the results callback.</p> - -<p>To handle errors during speech recognition listen for the -<code>onError</code> event.</p> - -<pre> -var callback = function(error) { ... }; - -chrome.experimental.speechInput.onError.addListener(callback); -</pre> - -</p>Recording will automatically stop in case of error. -It is safe to call <code>start()</code> again from the error callback.</p> - - -<h2 id="howToStop">How to stop recording</h2> -<p>To stop speech recognition call the <code>stop()</code> method. If provided, -the callback function will be called once recording has successfully stopped. -In case of error <code>chrome.runtime.lastError</code> will be set. -</p> - - -<h2 id="otherFeatures">Other features</h2> -<ul><li> -<code>onSoundStart</code> - Event generated when start of sound is detected -(from previously being silent). -</li><li> -<code>onSoundEnd</code> - Event generated when end of sound is detected (a -continued period of silence). -</li></ul> - - -<h2 id="examples">Examples</h2> -<p>The following example illustrates how to show a JavaScript alert with the -most likely recognition result.</p> -<pre> -function checkStart() { - if (chrome.runtime.lastError) { - alert("Couldn't start speech input: " + chrome.runtime.lastError.message); - } -} - -function recognitionFailed(error) { - alert("Speech input failed: " + error.code); -} - -function recognitionSucceeded(result) { - alert("Recognized '" + result.hypotheses[0].utterance + "' with confidence " + result.hypotheses[0].confidence); -} - -chrome.experimental.speechInput.onError.addListener(recognitionFailed); -chrome.experimental.speechInput.onResult.addListener(recognitionSucceeded); -chrome.experimental.speechInput.start({ "language": "en" }, checkStart); -</pre> diff --git a/chrome/common/extensions/docs/templates/public/extensions/experimental_speechInput.html b/chrome/common/extensions/docs/templates/public/extensions/experimental_speechInput.html deleted file mode 100644 index ac10ceb..0000000 --- a/chrome/common/extensions/docs/templates/public/extensions/experimental_speechInput.html +++ /dev/null @@ -1 +0,0 @@ -{{+partials.standard_extensions_api api:apis.experimental_speech_input intro:intros.experimental_speechInput}} |