Speech
Last updated
Last updated
The Speech extender component enhances all Wisej.NET components by providing additional speech synthesis and recognition features that allow a component to speak it’s content – or any text provided in code – and to receive text coming from speech recognition.
The Speech extension can be added to a Wisej.NET project using NuGet Package Manager.
For SpeechSynthesis it´s important to set up the SpeakMode:
Never. Speech is disabled for this control.
TextOnEnter. Speaks the specified text when the control is activated.
TextOnLeave, Speaks the specified text when the control is deactivated.
ValueOnEnter. Speaks the value of the control when it is activated.
ValueOnLeave. Speaks the value of the control when it is deactivated.
TextOnEnterOnce. Speaks the specified text when the control is activated the first time only.
TextOnLeaveOnce. Speaks the specified text when the control is deactivated the first time only.
ValueOnEnterOnce. Speaks the value of the control when it is activated the first time only.
ValueOnLeaveOnce. Speaks the value of the control when it is deactivated the first time only.
Further configure the SpeechSynthesis using Voice, Language, Volume, Rate and Pitch property.
SpeechSynthesis can be controlled with the Methods Pause, Speak, Resume, and Cancel.
Sample usage for SpeechSynthesis.
For SpeechRecognition you need to specify a Language.
If not specified, this defaults to the HTML lang attribute value, or the user agent's language setting if that isn't set either. Other properties are Continuous, MaxAlternatives and Grammars. Please refer to the JSpeech Grammar Format (JSGF).for the latter.
Use these methods with SpeechRecognition: Start, Stop, Abort, and Clear. Use GetSpeechRecognition and SetSpeedRecognition to define further properties. Feedback from SpeedRecognition is provided through these events: Result, NoMatch, Error, SpeechStart and SpeechEnd.
The SpeechSynthesis interface of the Web Speech API is the controller interface for the speech service; this can be used to retrieve information about the synthesis voices available on the device, start and pause speech, and other commands besides.
The SpeechRecognition interface of Web Speech API allows JavaScript to have access to a browser's audio stream and convert it to text.