Skip to main content

SpeechRecognition

Namespace: Wisej.Web.Ext.Speech

Assembly: Wisej.Web.Ext.Speech

The SpeechRecognition interface of Web Speech API allows JavaScript to have access to a browser's audio stream and convert it to text.

public class SpeechRecognition : Component, IExtenderProvider

Constructors

Instance memberSpeechRecognition()

Properties

Instance memberContinuous

Boolean: Controls whether continuous results are returned for each recognition, or only a single result. (Default: False)

Instance memberEnabled

Boolean: Enables or disables the this SpeechRecognition extender. (Default: False)

Instance memberGrammars

String[]: Returns and sets a collection of grammar definitions - using the JSpeech Grammar Format (JSGF) https://www.w3.org/TR/jsgf/.

Instance memberInterimResults

Boolean: Controls whether interim results should be returned (true) or not (false.) Interim results are results that are not yet final (e.g. the SpeechRecognitionResult.isFinal property is false.) (Default: False)

Instance memberLanguage

String: Returns and sets the language of the current SpeechRecognition. If not specified, this defaults to the HTML lang attribute value, or the user agent's language setting if that isn't set either. (Default: null)

Instance memberMaxAlternatives

Int32: Returns and sets the maximum number of alternatives provided per each speech recognition result. (Default: 1)

Methods

Instance memberAbort()

Stops the speech recognition service from listening to incoming audio, and doesn't attempt to return a result.

Instance memberCanExtend(target)

Returns true if SpeechRecognition can offer an extender property to the specified target component.

ParameterTypeDescription
targetObjectThe target object to add an extender property to.

Returns: Boolean. true if the SpeechRecognition class can offer one or more extender properties; otherwise, false.

Instance memberClear()

Removes all speech extenders.

Instance memberGetSpeechRecognition(control)

SpeechRecognition properties.

ParameterTypeDescription
controlControlThe Control for which to retrieve the speech properties.

Returns: Properties. A Properties instance with the SpeechRecognition properties.

Instance memberSetSpeechRecognition(control, properties)

Assigns the speech recognition properties to the control.

ParameterTypeDescription
controlControlThe control to rotate.
propertiesPropertiesAn instance of Properties defining the speech listeners.

Instance memberStart()

Starts the speech recognition service listening to incoming audio.

Instance memberStop()

Stops the speech recognition service from listening to incoming audio, and attempts to return a result using the audio captured so far.

Events

Instance memberError

SpeechRecognitionEventHandler Occurs when a speech recognition error is detected.

Instance memberNoMatch

EventHandler Occurs when the speech recognition service returns a final result with no significant recognition (when the nomatch event fires.)

Instance memberResult

SpeechRecognitionEventHandler Fired when the speech recognition service returns a result — a word or phrase has been positively recognized and this has been communicated back to the app (when the result event fires.)

Instance memberSpeechEnd

EventHandler Occurs when speech recognised by the speech recognition service has stopped being detected (when the speechend event fires.)

Instance memberSpeechStart

EventHandler Occurs when sound recognised by the speech recognition service as speech has been detected.