TEnhVoiceCommand component
    TEnhVoiceCommand

Properties	Methods	Events

Unit

EnhAviCap

Description

The TEnhAviCap component handles video display and capture with video for windows devices.

Shareware

Please, note that this component is shareware. You can try it to see if it fits your needs but you can't sell nor use it in commercial programs. To make a long story short: you can't gain money through this component.

The component will work correctly while Delphi 2 is running.

The registration fee is, at present, 39 US$, but, for updated infos and special offers look on the web.

Over the web, you can find how to register this component at http://ascu.unian.it/~milani/delphi

If the above link should ever be moved, try looking at the DSP (Delphi Super Page) http://sunsite.icm.edu.pl/delphi.

My e-mail address is mc3078@mclink.it or milani@ascu.unian.it.


Properties

ApplicationName	Enabled	StateName
AutoGain	Exists	Threshold
Awake	Local
Commands	Speaker


Events

OnAttribChanged	OnInterference	OnVUMeter
OnCommandOther	OnMenuActivate
OnCommandRecognize	OnUtteranceBegin
OnCommandStart	OnUtteranceEnd


Methods

AboutDlg	LexiconDlg	TrainMenu
GeneralDlg	TrainGeneral	TrainMic


ApplicationName

Declaration

property ApplicationName: string;

Description

This property must contains the name of your application. This name will be used by the speech engine to store and retrieve internal default values for your application.


AutoGain

Declaration

property AutoGain: integer;

Description

This property sets or reads the current automatic gain value.

A value of 0 indicates that automatic gain is disabled. A value of 100 indicates that the gain is set perfectly if the next utterance is spoken at the same level. A value between 0 and 100 moderates the automatic adjustments on a linear scale. For example, a value of 50 adjusts the gain to 50% of the level for the previous utterance.


Awake

Declaration

property awake: boolean;

Description

This property sets or reads the awake state. When the site is awake, it listens for commands from any active voice menu for the active application.

The sleep state for a site is saved between uses of the site, even if the user shuts down the computer in the meantime.

If a voice-navigation application is installed on the user’s computer, an application may not need to set the sleep state. However, it may set awake to TRUE to make sure that speech recognition is awake. For example, if an application speaks (with voice text or text-to-speech) “Do you want to print the document?” it might enable and wake up speech recognition for the site to receive the user’s reply. The application should then restore speech recognition to its previous state.


Commands

Declaration

property commands: TStrings;

Description

Contains the list of commands recognized by the application. At present the speech engine works fine with the english language, so keep it in mind when you select the commands to be recognized (i.e.: use english commands to get better results).


Enabled

Declaration

property enabled: boolean;

Description

This property sets or reads the enabled state. When speech recognition is disabled, the engine does not recognize any command from any menu, whether speech recognition is awake or asleep or any menus are active.

Set enabled to FALSE to turn speech recognition completely off, as opposed to suspending speech recognition temporarily by putting the site to sleep with the awake property.

The enabled state for a site is saved between uses of the site, even if the user shuts down the computer in the meantime.


Exists

Declaration

property exists: boolean;

Description

Read-only. The exists property returns TRUE if voice commands are supported on the computer where the program is installed.


Local

Declaration

property local: boolean;

Description

This property defines whether a set of commands are local or global.

Local commands are recognized only when the window is the foreground window.

Global commands are recognized regardless of the foreground window.


Speaker

Declaration

property speaker: string;

Description

This property sets or reads the name of the current speaker.

Changing the speaker name unloads all training for the previous speaker and loads the training for the new speaker. If no training exists for the new speaker, the application starts with default training.

The speaker name for a site is saved between uses of the site, even if the user shuts down the computer in the meantime.


StateName

Declaration

property StateName: string;

Description

This property sets or reads the name of the state in which the program is when the commands are enabled. Use values such as “Main menu” or “File Open dialog box”. This property is used by the speech engine to store and retrieve internal default values for your application, together with ApplicationName.


Threshold

Declaration

property threshold: integer;

Description

This property sets or reads the threshold level. The threshold level is a value from 0 to 100 that indicates the point below which an utterance is rejected as unrecognized. A threshold level of 0 indicates that the engine should match any utterance to the closest phrase match. A value of 100 indicates that the engine should be absolutely certain that an utterance is the recognized phrase. If the value is out of range for the engine, the attribute is not changed.

The threshold for a site is saved between uses of the site, even if the user shuts down the computer in the meantime.


OnAttribChanged

Declaration

TVCAttribChangedEvent = procedure(sender: TObject;attribute: integer) of object;

property OnAttribChanged: TVCAttribChangedEvent;

Description

Notifies applications on a voice-command site that a site attribute has changed.

Attribute can be one of these values:

Value	Meaning
IVCNSAC_AWAKE	Awake state
IVCNSAC_AUTOGAINENABLE	Automatic gain
IVCNSAC_DEVICE	Wave-in audio device
IVCNSAC_ENABLED	Enabled state
IVCNSAC_MICROPHONE	Current microphone
IVCNSAC_ORIGINAPP	The application receiving this notification originated the attribute change
IVCNSAC_SPEAKER	Name of the current speaker
IVCNSAC_SRMODE	Speech-recognition mode
IVCNSAC_THRESHOLD	Confidence threshold


OnCommandOther

Declaration

TVCCmdOtherEvent = procedure(sender         : TObject;

                             ApplicationName: string;

                             StateName      : string;

                             command        : string) of object;

property OnCommandOther: TVCCmdOtherEvent;

Description

Sent when a spoken phrase was either recognized as being from another application’s command set or was not recognized. Along with the notification, the application receives the address of the command.

If command='' then the command was not recognized.

If two applications use the same command, it is indeterminate which of the application will receive the OnCommandOther event and which will receive the OnCommandRecognize event.

This happens only if the commands are all global or all window specific.


OnCommandRecognize

Declaration

TVCCmdRecognizeEvent = procedure(sender         : TObject;

                                 ID             : longint;

                                 ApplicationName: string;

                                 StateName      : string;

                                 flags          : longint;

                                 ActionSize     : longint;

                                 action         : pointer;

                                 NumLists       : longint;

                                 ListValues     : PChar;

                                 command        : string) of object;

property OnCommandRecognize: TVCCmdRecognizeEvent;

Description

Sent when a spoken phrase was recognized as being from the application’s command set. Along with the notification, the application receives the text of the phrase.

If two applications use the same command, it is indeterminate which of the application will receive the OnCommandOther event and which will receive the OnCommandRecognize event.

This happens only if the commands are all global or all window specific.


OnCommandStart

Declaration

property OnCommandStart: TNotifyEvent;

Description

Notifies applications on a voice-command site that recognition processing has begun for a command.

An application can use OnCommandStart to indicate that it is processing what the user said. Most applications will ignore this notification.


OnInterference

Declaration

TVCInterferenceEvent = procedure(sender: TObject;IntType: integer) of object;

property OnInterference: TVCInterferenceEvent;

Description

Notifies the application that the engine cannot recognize speech properly for a known reason.

IntType can be one of these values:

Value	Meaning
SRMSGINT_AUDIODATA_STARTED	The engine has resumed receiving audio data from the audio source.
SRMSGINT_AUDIODATA_STOPPED	The engine has stopped receiving audio data from the audio source.
SRMSGINT_NOISE	The background noise is too high.
SRMSGINT_NOSIGNAL	The engine cannot detect a signal, possibly because the microphone is off or unplugged.
SRMSGINT_TOOLOUD	The speaker is too loud;  recognition results may be degraded.
SRMSGINT_TOOQUIET	The speaker is too quiet; recognition results may be degraded.


OnMenuActivate

Declaration

TVCMenuActivateEvent = procedure(sender         : TObject;

                                 ApplicationName: string;

                                 StateName      : string;

                                 active         : boolean) of object;

property OnMenuActivate: TVCMenuActivateEvent;

Description

Notifies applications on a voice-command site that a voice menu has been activated or deactivated, either explicitly by the application or as a result of the user switching to or from the window associated with the menu.


OnUtteranceBegin

Declaration

property OnUtteranceBegin: TNotifyEvent;

Description

Notifies applications on a voice-command site that the speech-recognition engine has detected the beginning of an utterance or sound.

Detecting the beginning of an utterance does not necessarily have any bearing on the recognition of commands. An OnUtteranceBegin notification implicitly signals the end of silence, so an application can use this notification to detect long periods of silence and react accordingly.


OnUtteranceEnd

Declaration

property OnUtteranceEnd: TNotifyEvent;

Description

Notifies applications on a voice-command site that an utterance is finished.

A speech-recognition engine typically sends this notification 0.25 to 0.5 of a second after speech stops. This notification does not necessarily have any bearing on the recognition of commands. An OnUtteranceEnd notification implicitly signals the beginning of silence, so an application can use this notification to detect long periods of silence and react accordingly.


OnVUMeter

Declaration

TVCVUMeterEvent = procedure(sender: TObject;level: integer) of object;

property OnVUMeter: TVCVUMeterEvent;

Description

Notifies the application of the current VU level, which indicates the loudness of the digital-audio stream.

The level can be from 0 to $FFFF that indicates a linear level. $FFFF is the loudest volume that the VU meter will register.


AboutDlg

Declaration

function AboutDlg(AParent: HWnd;ATitle: string): boolean;

Description

Displays an About dialog box that identifies the speech-recognition engine and contains the copyright notice.

Returns TRUE if the dialog is supported.

AParent specifies the handle of the window to be used as a parent. If this parameter is 0 returns TRUE if the dialog is supported.

ATitle specifies the string to be used as the title of the dialog box. If ATitle='' then a default title will be used.


GeneralDlg

Declaration

function GeneralDlg(AParent: HWnd;ATitle: string): boolean;

Description

Displays a General dialog box, which gives the user general control of the speech-recognition engine and provides the user with full access to engine-specific controls.

Depending on the engine, the General dialog box may allow users to perform these tasks:

- Inform the engine of the speaker’s gender or other speaker-specific information.

- Control how stringent the engine is about recognition.

- Control the maximum amount of disk space allotted for speaker information.

- Control optimizations that reduce processing.

- Export and import speaker information to and from a disk so that this information can be transferred between systems.

Returns TRUE if the dialog is supported.

AParent specifies the handle of the window to be used as a parent. If this parameter is 0 returns TRUE if the dialog is supported.

ATitle specifies the string to be used as the title of the dialog box. If ATitle='' then a default title will be used.


LexiconDlg

Declaration

function LexiconDlg(AParent: HWnd;ATitle: string): boolean;

Description

Displays a Lexicon dialog box, which allows the user to display and edit his or her pronunciation lexicon. For example, the speaker can edit the phonetics of mispronounced words and load or unload personal exception dictionaries.

Returns TRUE if the dialog is supported.

AParent specifies the handle of the window to be used as a parent. If this parameter is 0 returns TRUE if the dialog is supported.

ATitle specifies the string to be used as the title of the dialog box. If ATitle='' then a default title will be used.


TrainGeneral

Declaration

function TrainGeneral(AParent: HWnd;ATitle: string): boolean;

Description

Displays a General Training dialog box, which trains a speech-recognition engine by having the user speak a preselected set of words. After the user speaks these words and phrases, recognition accuracy should be better for that particular user.

Returns TRUE if the dialog is supported.

AParent specifies the handle of the window to be used as a parent. If this parameter is 0 returns TRUE if the dialog is supported.

ATitle specifies the string to be used as the title of the dialog box. If ATitle='' then a default title will be used.


TrainMenu

Declaration

function TrainMenu(AParent: HWnd;ATitle: string): boolean;

Description

Returns TRUE if the dialog is supported.

AParent specifies the handle of the window to be used as a parent. If this parameter is 0 returns TRUE if the dialog is supported.

ATitle specifies the string to be used as the title of the dialog box. If ATitle='' then a default title will be used.


TrainMic

Declaration

function TrainMic(AParent: HWnd;ATitle: string): boolean;

Description

Displays a Microphone Training dialog box, which trains the speech-recognition engine with training for a microphone. This dialog box should be displayed at the request of the engine or whenever the speaker wants to display it.

Returns TRUE if the dialog is supported.

AParent specifies the handle of the window to be used as a parent. If this parameter is 0 returns TRUE if the dialog is supported.

ATitle specifies the string to be used as the title of the dialog box. If ATitle='' then a default title will be used.

Training information will be associated with both the speaker and the microphone. Ideally, TrainMicDlg will train the engine only for the microphone and any surrounding sounds, but it is also likely to train for the speaker’s voice.

If the engine does not supply this dialog box, the speaker cannot train it for the microphone; however, the application will still work.