diff options
Diffstat (limited to 'chrome/common/extensions/api/experimental_speech_input.json')
-rw-r--r-- | chrome/common/extensions/api/experimental_speech_input.json | 166 |
1 files changed, 166 insertions, 0 deletions
diff --git a/chrome/common/extensions/api/experimental_speech_input.json b/chrome/common/extensions/api/experimental_speech_input.json new file mode 100644 index 0000000..280eb9d --- /dev/null +++ b/chrome/common/extensions/api/experimental_speech_input.json @@ -0,0 +1,166 @@ +// Copyright (c) 2012 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. + +[ + { + "namespace": "experimental.speechInput", + "types": [ + { + "id": "SpeechInputStartOptions", + "type": "object", + "description": "Object describing the options used for speech recognition.", + "properties": { + "language": { + "type": "string", + "optional": true, + "description": "BCP-47 language code of the language to recognize. When set to 'auto' or not defined defaults to user's most preferred content language. Will use 'en-US' if not supported or invalid." + }, + "grammar": { + "type": "string", + "description": "Name of the grammar to use. Defaults to 'builtin:dictation'.", + "optional": true + }, + "filterProfanities": { + "type": "boolean", + "optional": true, + "description": "Enable or disable profanity filtering. Will use the default Chrome filtering settings if not set." + } + } + }, + { + "id": "SpeechInputError", + "type": "object", + "description": "Object describing a speech input error.", + "properties": { + "code": { + "type": "string", + "enum": ["noSpeechHeard", "noResults", "captureError", "networkError"], + "description": "Code identifying the error case." + } + } + }, + { + "id": "SpeechInputResultHypothesis", + "type": "object", + "description": "Object describing a speech recognition hypothesis.", + "properties": { + "utterance": { + "type": "string", + "description": "Text of this hypothesis." + }, + "confidence": { + "type": "number", + "description": "Confidence of the hypothesis. Rated from 0 (lowest) to 1 (highest)." + } + } + }, + { + "id": "SpeechInputResultEvent", + "type": "object", + "description": "Object containing the recognition results.", + "properties": { + "hypotheses": { + "type": "array", + "optional": true, + "description": "Array of zero or more objects describing the stable candidate hypotheses sorted by decreasing likelihood.", + "items": { "$ref": "SpeechInputResultHypothesis" } + } + } + } + ], + "functions": [ + { + "name": "start", + "type": "function", + "description": "Request to start recording as a new speech recognition session.", + "parameters": [ + { + "name": "options", + "$ref": "SpeechInputStartOptions", + "optional": true, + "description": "Options used for this speech recognition session." + }, + { + "name": "callback", + "type": "function", + "optional": true, + "description": "Called when the speech recognition session has successfully started recording.", + "parameters": [] + } + ] + }, + { + "name": "stop", + "type": "function", + "description": "Request to stop an ongoing speech recognition session.", + "parameters": [ + { + "name": "callback", + "type": "function", + "optional": true, + "description": "Called when the audio recording has stopped and any pending recognition results have been completed.", + "parameters": [] + } + ] + }, + { + "name": "isRecording", + "type": "function", + "description": "Determine if audio recording is currently in process in Chrome, not limited to this API.", + "parameters": [ + { + "name": "callback", + "type": "function", + "optional": true, + "parameters": [ + { + "name": "result", + "type": "boolean", + "description": "Flag set to true if recording is in process in Chrome, false otherwise." + } + ] + } + ] + } + ], + "events": [ + { + "name": "onError", + "type": "function", + "description": "Called in case of an error in speech recognition.", + "parameters": [ + { + "name": "error", + "$ref": "SpeechInputError", + "description": "Error being reported." + } + ] + }, + { + "name": "onSoundStart", + "type": "function", + "description": "Called when the system starts detecting sound in the input data.", + "parameters": [] + }, + { + "name": "onSoundEnd", + "type": "function", + "description": "Called when the system detects enough silence to consider the ongoing speech has ended.", + "parameters": [] + }, + { + "name": "onResult", + "type": "function", + "description": "Called when speech recognition results are available.", + "parameters": [ + { + "name": "event", + "$ref": "SpeechInputResultEvent", + "description": "Object containing the speech recognition results." + } + ] + } + ] + } +] |