chrome.experimental.speechInput
For information on how to use experimental APIs, see the chrome.experimental.* APIs page.
API reference: chrome.experimental.speechInput
Properties
getLastError
chrome.extensionlastError
Methods
isRecording
void
chrome.experimental.speechInput.isRecording(, function
callback)
Undocumented.
Determine if audio recording is currently in process in Chrome, not limited to this API.
Parameters
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
-
Description of this parameter from the json schema.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function(boolean result) {...};
-
result
(
optional
enumerated
Type
array of
boolean
)
-
Undocumented.
- Flag set to true if recording is in process in Chrome, false otherwise.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
start
void
chrome.experimental.speechInput.start(, SpeechInputStartOptions
options, function
callback)
Undocumented.
Request to start recording as a new speech recognition session.
Parameters
-
options
-
Undocumented.
- Options used for this speech recognition session.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
- Called when the speech recognition session has successfully started recording.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function() {...};
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
stop
void
chrome.experimental.speechInput.stop(, function
callback)
Undocumented.
Request to stop an ongoing speech recognition session.
Parameters
-
callback
(
optional
enumerated
Type
array of
function
)
-
Undocumented.
- Called when the audio recording has stopped and any pending recognition results have been completed.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
Returns
Callback function
The callback parameter should specify a function
that looks like this:
If you specify the callback parameter, it should
specify a function that looks like this:
function() {...};
This function was added in version .
If you require this function, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
Events
onError
chrome.experimental.speechInput.onError.addListener(function(SpeechInputError error) {...});
Undocumented.
Called in case of an error in speech recognition.
Listener parameters
-
error
-
Undocumented.
- Error being reported.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
Extra parameters to addListener
Listener returns
onResult
chrome.experimental.speechInput.onResult.addListener(function(SpeechInputResultEvent event) {...});
Undocumented.
Called when speech recognition results are available.
Listener parameters
-
event
-
Undocumented.
- Object containing the speech recognition results.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
Extra parameters to addListener
Listener returns
onSoundEnd
chrome.experimental.speechInput.onSoundEnd.addListener(function() {...});
Undocumented.
Called when the system detects enough silence to consider the ongoing speech has ended.
Extra parameters to addListener
Listener returns
onSoundStart
chrome.experimental.speechInput.onSoundStart.addListener(function() {...});
Undocumented.
Called when the system starts detecting sound in the input data.
Extra parameters to addListener
Listener returns
Types
SpeechInputStartOptions
paramName
(
optional
enumerated
Type
array of
object
)
Undocumented.
Object describing the options used for speech recognition.
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
language
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- 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.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
grammar
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- Name of the grammar to use. Defaults to 'builtin:search'.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
filterProfanities
(
optional
enumerated
Type
array of
boolean
)
-
Undocumented.
- Enable or disable profanity filtering. Will use the default Chrome filtering settings if not set.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
SpeechInputError
paramName
(
optional
enumerated
Type
array of
object
)
Undocumented.
Object describing a speech input error.
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
code
(
optional
enumerated
Type
array of
string
["noSpeechHeard", "noResults", "captureError", "networkError"]
)
-
Undocumented.
- Code identifying the error case.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
SpeechInputResultHypothesis
paramName
(
optional
enumerated
Type
array of
object
)
Undocumented.
Object describing a speech recognition hypothesis.
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
utterance
(
optional
enumerated
Type
array of
string
)
-
Undocumented.
- Text of this hypothesis.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
-
confidence
(
optional
enumerated
Type
array of
number
)
-
Undocumented.
- Confidence of the hypothesis. Rated from 0 (lowest) to 1 (highest).
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-
SpeechInputResultEvent
paramName
(
optional
enumerated
Type
array of
object
)
Undocumented.
Object containing the recognition results.
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
hypotheses
-
Undocumented.
- Array of zero or more objects describing the stable candidate hypotheses sorted by decreasing likelihood.
-
This parameter was added in version
.
You must omit this parameter in earlier versions,
and you may omit it in any version. If you require this
parameter, the manifest key
minimum_chrome_version
can ensure that your extension won't be run in an earlier browser version.
-
-
-
-