PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Special cases
  • Application in the background: Android 10 specific case
  • 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
// Display the propositions returned by the speech recognition service in a List Box control
MyList is string
MyList = SpeechRecognitionTrigger("I am listening to you ...")
IF ErrorOccurred = False THEN
FOR EACH STRING Proposition OF MyList SEPARATED BY CR
ListAdd(LIST_ListProposition, Proposition)
END
END
Syntax
<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 find out the error details, use ErrorInfo.
<Text>: Optional character string (with quotes)
Text that will be displayed in the window displayed by the service for speech recognition.
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. SpeechRecognitionTrigger is a locking function as long as this window is displayed.
  • 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: SpeechRecognitionTrigger requires an Internet connection therefore it cannot be used in off-line 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: Android 10 specific case

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). When the notification is clicked on, the application will be brought back to the foreground if ..ActivateApplication is set to True. It is also possible to open a window from the procedure passed to ..ActionClick.
New in version 25
AndroidAndroid Widget

Application in the background: Android 10 specific case

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). When the notification is clicked on, the application will be brought back to the foreground if ..ActivateApplication is set to True. It is also possible to open a window from the procedure passed to ..ActionClick.
AndroidAndroid Widget

Application in the background: Android 10 specific case

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). When the notification is clicked on, the application will be brought back to the foreground if ..ActivateApplication is set to True. It is also possible to open a window from the procedure passed to ..ActionClick.
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 : wd250android.jar
Minimum version required
  • Version 17
Comments
Click [Add] to post a comment