PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

This content has been translated automatically. Click here to view the French version.
  • Phonetic recognition
  • Caution
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
AddVoiceCommand (Function)
In french: AjouteCommandeVocale
Warning
From version 17, this function is replaced with SpeechRecognitionAddCommand.
Adds a voice command into the current window. The command is automatically disabled when closing the window. This voice command can be deleted by DeleteVoiceCommand.
Remark: a speech recognition program must be installed on the runtime computer. A speech recognition program is supplied with Windows Vista. For the other systems, "Dragon Naturally Speaking" must be installed (tests run with version 9 "Preferred" or "standard").
Example
// Lance la procédure "Proc_Anim_Fenêtre" si la commande vocale est reconnue
nIdVoix is int
nIdVoix = AddVoiceCommand("Proc_Anim_Fenêtre", "Animer la fenêtre")
// Lance la procédure "Trouver" si la commande vocale est reconnue
nIdVoix1 is int = AddVoiceCommand(Trouver, "Trouve la fiche de")
nIdVoix2 is int = AddVoiceCommand(Trouver, "Affiche la fiche de")
nIdVoix3 is int = AddVoiceCommand(Trouver, "Cherche la fiche de")
 
INTERNAL PROCÉDURE Trouver(Param1)
sClient is string = Param1[[21 TO ]]
HReadSeekFirst(sClient, PRENOMNOM, sClient)
END
Syntax
<Result> = AddVoiceCommand(<WLanguage procedure> , <Sentence to recognize>)
<Result>: entier
Identifier of voice command.
<WLanguage procedure>: Procedure name
Name of the procedure that will be run when the voice command is heard. This procedure has the following format:
PROCEDURE <Nom de la procédure> (<Nom du paramètre>)
<Parameter name> is a character string parameter. At runtime, <Parameter name> corresponds to the sentence that is recognized.
<Sentence to recognize>: Character string
Sentence used to trigger the execution of the procedure. If this parameter corresponds to an empty string (""), the specified procedure will be run for each sentence spoken.
Remarks

Phonetic recognition

If <Sentence to recognize> corresponds to an empty string (""), the procedure will be run for each sentence pronounced. This enables you to process the sentenced spoken in the procedure in order to recognize the voice command that was used.
You can for example store in an array (associative array for example) all the available voice commands (phonetically) and the procedure associated with each one of these commands.
To do so, pass each word of the sentence phonetically and compare the sentence with the array of voice commands. If the command is recognized, the associated procedure can be run.
To improve the understanding, you also have the ability to delete the unnecessary words found at the beginning and at the end of sentence.

Caution

The AddVoiceCommand function must be used in the initialization code of the window or an control. This function is not recognized if it is used in the initialization code of project.
Component: wd270obj.dll
Minimum version required
  • Version 12
This page is also available for…
Comments
Click [Add] to post a comment