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.
  • Special cases
  • Application in the background: Specific case from Android 10
  • Required permissions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Triggers the service for speech recognition on the device.
Remark: This function can be used in the emulator. This function cannot be used in the simulator.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Android Widget This function is now available in Android Widget mode.
Versions 23 and later
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 23
iPhone/iPad This function is now available for iPhone/iPad applications.
iPhone/iPad This function is now available for iPhone/iPad applications.
Example
// Affichage des propositions retournées par le service de reconnaissance vocale dans un champ Liste
MaListe is string
MaListe = SpeechRecognitionTrigger("Je vous écoute ...")
IF ErrorOccurred = False THEN
FOR EACH STRING Proposition OF MaListe SÉPARÉE BY CR
ListAdd(LISTE_ListeProposition, Proposition)
END
END
Syntax

Triggering the voice recognition service (synchronous mode) Hide the details

<Result> = SpeechRecognitionTrigger([<Text>])
<Result>: Character string
  • List of propositions for words or sentences made by the service for speech recognition from the text said by the user. Each proposition is separated by a CR character (Carriage Return).
  • Empty string ("") in the following cases:
    • if the speech recognition was canceled by the user.
    • if an error occurred.
    • if no correspondence was found by the service for speech recognition.
    In this case, the ErrorOccurred variable is set to True. To get the details of the error, use ErrorInfo.
<Text>: Optional character string (with quotes)
Text that will be displayed in the window displayed by the service for speech recognition. This window is blocking.
Versions 25 and later
iPhone/iPad

Triggering the voice recognition service (asynchronous mode) Hide the details

SpeechRecognitionTrigger([<Text>, ] <WLanguage procedure>)
<Text>: Optional character string (with quotes)
Text that will be displayed in the window displayed by the service for speech recognition. This window is not blocking.
<WLanguage procedure>: Procedure name
Name of the Procedure WLanguage (also called "callback") called to perform speech recognition. This Procedure allows you to obtain the different proposals of words or phrases. For more details on this procedure, see Parameters of the procedure used by SpeechRecognitionTrigger.
New in version 25
iPhone/iPad

Triggering the voice recognition service (asynchronous mode) Hide the details

SpeechRecognitionTrigger([<Text>, ] <WLanguage procedure>)
<Text>: Optional character string (with quotes)
Text that will be displayed in the window displayed by the service for speech recognition. This window is not blocking.
<WLanguage procedure>: Procedure name
Name of the Procedure WLanguage (also called "callback") called to perform speech recognition. This Procedure allows you to obtain the different proposals of words or phrases. For more details on this procedure, see Parameters of the procedure used by SpeechRecognitionTrigger.
iPhone/iPad

Triggering the voice recognition service (asynchronous mode) Hide the details

SpeechRecognitionTrigger([<Text>, ] <WLanguage procedure>)
<Text>: Optional character string (with quotes)
Text that will be displayed in the window displayed by the service for speech recognition. This window is not blocking.
<WLanguage procedure>: Procedure name
Name of the Procedure WLanguage (also called "callback") called to perform speech recognition. This Procedure allows you to obtain the different proposals of words or phrases. For more details on this procedure, see Parameters of the procedure used by SpeechRecognitionTrigger.
Remarks

Special cases

  • SpeechRecognitionTrigger is using the service for speech recognition of device. The function will fail if this service is not available.
  • A window will be opened as soon as the speech recognition is triggered ; this window informs the user of the start and end of session for speech recognition and it also displays the progress of process.
    • Syntax 1: SpeechRecognitionTrigger is a locking function as long as this window is displayed.
    • Versions 25 and later
      iPhone/iPad Syntax 2: The function SpeechRecognitionTrigger is not blocking as long as this window is displayed.. The processing of proposals is carried out in an Procedure WLanguage.
      New in version 25
      iPhone/iPad Syntax 2: The function SpeechRecognitionTrigger is not blocking as long as this window is displayed.. The processing of proposals is carried out in an Procedure WLanguage.
      iPhone/iPad Syntax 2: The function SpeechRecognitionTrigger is not blocking as long as this window is displayed.. The processing of proposals is carried out in an Procedure WLanguage.
  • If one of the propositions returned by the service for speech recognition corresponds to a command added to the current window by SpeechRecognitionAddCommand, the WLanguage procedure corresponding to this command will be run.
  • Caution: The SpeechRecognitionTrigger function requires an INTERNET connection and therefore cannot be used in non-row mode.
  • Versions 23 and later
    iPhone/iPad This function can be used from iOS 10.
    New in version 23
    iPhone/iPad This function can be used from iOS 10.
    iPhone/iPad This function can be used from iOS 10.
Versions 25 and later
AndroidAndroid Widget

Application in the background: Specific case from Android 10

From Android 10, it is no longer possible to open a window when the application is in the background.
SpeechRecognitionTrigger can open a window. If this function is used while the application is in the background, a fatal error will occur.
Tips:
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). The application will be brought back to the foreground when the notification is clicked, if the ActivateApplication property is set to True. You can also open a window from the procedure passed to the ActionClick property.
New in version 25
AndroidAndroid Widget

Application in the background: Specific case from Android 10

From Android 10, it is no longer possible to open a window when the application is in the background.
SpeechRecognitionTrigger can open a window. If this function is used while the application is in the background, a fatal error will occur.
Tips:
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). The application will be brought back to the foreground when the notification is clicked, if the ActivateApplication property is set to True. You can also open a window from the procedure passed to the ActionClick property.
AndroidAndroid Widget

Application in the background: Specific case from Android 10

From Android 10, it is no longer possible to open a window when the application is in the background.
SpeechRecognitionTrigger can open a window. If this function is used while the application is in the background, a fatal error will occur.
Tips:
  • It is possible to determine if the application is in the background using InBackgroundMode.
  • If an application needs to interact with the user while it is in the background, the solution is to display a notification (via the Notification type). The application will be brought back to the foreground when the notification is clicked, if the ActivateApplication property is set to True. You can also open a window from the procedure passed to the ActionClick property.
AndroidAndroid Widget

Required permissions

The call to this function modifies the permissions required by the application.
Required permission: INTERNET: this permission allows the applications to open the network sockets.
Related Examples:
Android Speech Synthesis Android (WINDEV Mobile): Android Speech Synthesis
[ + ] This educational example explains how to manage the recognition and the speech synthesis Android.
The speech synthesis is performed by using either the WLanguage functions, or an external JAR file included in the WINDEV Mobile project.
Business / UI classification: UI Code
Component: wd260android.aar
Minimum version required
  • Version 17
Comments
Click [Add] to post a comment