Speech

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.

Features

How to Use

The Speech extension can be added to a Wisej.NET project using NuGet Package Manager.

SpeechSynthesis

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.

using (speechSynthesis synthesis = new Wisej.Web.Ext.Speech.SpeechSynthesis())
{
    synthesis.Speak("The CPU is running at 99%.");
}

SpeechRecognition

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.

Last updated