Class SpeechRecognition
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The SpeechRecognition interface of the Web Speech API is the controller interface for the recognition service; this also handles the SpeechRecognitionEvent sent from the recognition service.
[Value("SpeechRecognition")]
public class SpeechRecognition : EventTarget
- Inheritance
-
SpeechRecognition
- Inherited Members
Remarks
NOTE
On some browsers, like Chrome, using Speech Recognition on a web page involves a server-based recognition engine. Your audio is sent to a web service for recognition processing, so it won't work offline.
Constructors
SpeechRecognition()
The SpeechRecognition() constructor creates a new
SpeechRecognition object instance.
public SpeechRecognition()
Remarks
Properties
Continuous
The continuous property of the
SpeechRecognition interface controls whether continuous results are
returned for each recognition, or only a single result.
[Value("continuous")]
public bool Continuous { get; set; }
Property Value
- bool
A boolean value representing the current
SpeechRecognition's
continuous status.truemeans continuous, andfalsemeans not
continuous (single result each time.)
Remarks
Grammars
The grammars property of the
SpeechRecognition interface returns and sets a collection of
SpeechGrammar objects that represent the grammars that will be understood
by the current SpeechRecognition.
[Value("grammars")]
public SpeechGrammarList Grammars { get; set; }
Property Value
- SpeechGrammarList
A SpeechGrammarList containing the SpeechGrammar objects
that represent your grammar for your app.
Remarks
InterimResults
The interimResults property of the
SpeechRecognition interface controls whether interim results should be
returned (true) or not (false). Interim results are results
that are not yet final (e.g., the IsFinal property
is false).
[Value("interimResults")]
public bool InterimResults { get; set; }
Property Value
- bool
A boolean value representing the state of the current
SpeechRecognition's interim results.truemeans interim
results are returned, andfalsemeans they aren't.
Remarks
Lang
The lang property of the SpeechRecognition
interface 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.
[Value("lang")]
public string Lang { get; set; }
Property Value
- string
A string representing the BCP 47 language tag for the current
SpeechRecognition.
Remarks
MaxAlternatives
The maxAlternatives property of the
SpeechRecognition interface sets the maximum number of
SpeechRecognitionAlternatives provided per
SpeechRecognitionResult.
[Value("maxAlternatives")]
public ulong MaxAlternatives { get; set; }
Property Value
- ulong
A number representing the maximum returned alternatives for each result.
Remarks
Onaudioend
[Value("onaudioend")]
public EventHandlerNonNull Onaudioend { get; set; }
Property Value
Onaudiostart
[Value("onaudiostart")]
public EventHandlerNonNull Onaudiostart { get; set; }
Property Value
Onend
[Value("onend")]
public EventHandlerNonNull Onend { get; set; }
Property Value
Onerror
[Value("onerror")]
public EventHandlerNonNull Onerror { get; set; }
Property Value
Onnomatch
[Value("onnomatch")]
public EventHandlerNonNull Onnomatch { get; set; }
Property Value
Onresult
[Value("onresult")]
public EventHandlerNonNull Onresult { get; set; }
Property Value
Onsoundend
[Value("onsoundend")]
public EventHandlerNonNull Onsoundend { get; set; }
Property Value
Onsoundstart
[Value("onsoundstart")]
public EventHandlerNonNull Onsoundstart { get; set; }
Property Value
Onspeechend
[Value("onspeechend")]
public EventHandlerNonNull Onspeechend { get; set; }
Property Value
Onspeechstart
[Value("onspeechstart")]
public EventHandlerNonNull Onspeechstart { get; set; }
Property Value
Onstart
[Value("onstart")]
public EventHandlerNonNull Onstart { get; set; }
Property Value
Methods
Abort()
The abort() method of the Web Speech API stops the speech
recognition service from listening to incoming audio, and doesn't attempt to return a
SpeechRecognitionResult.
[Value("abort")]
public GlobalObject.Undefined Abort()
Returns
Remarks
Start()
The start() method of the Web Speech API starts the speech
recognition service listening to incoming audio with intent to recognize grammars
associated with the current SpeechRecognition.
[Value("start")]
public GlobalObject.Undefined Start()
Returns
Remarks
Stop()
The stop() method of the Web Speech API stops the speech
recognition service from listening to incoming audio, and attempts to return a
SpeechRecognitionResult using the audio captured so far.
[Value("stop")]
public GlobalObject.Undefined Stop()