AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones específicas para móviles / Funciones de síntesis de voz
  • Operating mode
  • Application in the background: Specific case from Android 10
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Reads the content of the specified file by using the engine for speech synthesis found on the device.
Example
SpeechSynthesisReadFile("/sdcard/email.txt")
Syntax
<Result> = SpeechSynthesisReadFile(<Name and path of text file> [, <Locking>])
<Result>: Boolean
  • True if the file content was read (locking mode) or if the file content was added to the reading queue (non-locking mode),
  • False in case of failure. If an error occurs, the ErrorOccurred variable is set to True. To get more details on the error, use ErrorInfo.
<Name and path of text file>: Character string
Name and full (or relative) path of text file to read.
<Locking>: Optional boolean
  • True function is executed in blocking mode. The code following the call to the function will be run once the entire file is read or when the function fails. An hourglass will be displayed during the read operation. Use NextTitle to customize the message displayed by the hourglass.
    iPhone/iPadIOS WidgetMac Catalyst This runtime mode is not available.
  • False (default): function is executed in non-blocking mode. The code following the call to the function will be run as soon as the reading of the file starts or when the function fails.
Remarks

Operating mode

  • AndroidAndroid Widget Speech synthesis functions are only available on devices with Android 1.6 or higher (API level 4).
    A fatal error occurs if the function is used with an earlier system version.
    To determine the version of Android the application is running on, use SysAndroidVersion.
  • iPhone/iPadIOS WidgetMac Catalyst Speech synthesis functions are only available on devices with iOS 7 and higher. The speech synthesis does not work on the iOS 8 emulators.
  • AndroidAndroid Widget If no engine for speech synthesis is installed on the device, its download will be automatically proposed.
  • If a new read operation is triggered while another read operation is in progress, the new read operation will start once the first one is over.
    To know whether a read operation is in progress on the speech synthesis engine, use SpeechSynthesisInProgress.
    To stop the current read operations, use SpeechSynthesisStop.
  • To define the parameters that will be used by the engine for speech synthesis (language, reading speed, etc.), use SpeechSynthesisInitialize.
    If the parameters of speech synthesis have not been defined by SpeechSynthesisInitialize, the default parameters will be used and the language for text reading will be the first language available for the engine of speech synthesis according to the following sequence:
    • Application language (default language or language defined by Nation),
    • Language of device,
    • English,
    • Default language of engine for speech synthesis.
  • To read the content of a character string, use SpeechSynthesisReadText.
  • AndroidAndroid Widget To adjust the volume, use VolumeModify with the volumeMusic constant.
AndroidAndroid Widget

Application in the background: Specific case from Android 10

Starting with Android 10, it is no longer possible to open a window when the application is in the background.
SpeechSynthesisReadFile 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.
Component: wd300android.aar
Versión mínima requerida
  • Versión 17
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 28/03/2025

Señalar un error o enviar una sugerencia | Ayuda local