PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Operating mode
  • Application in the background: Specific case from Android 10
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
Initializes the parameters of speech synthesis for the current application. You can initialize:
  • Only the language used (syntax 1).
  • Versions 26 and later
    All the voice characteristics via a SpeechSynthesisVoice variable (syntax 2).
    New in version 26
    All the voice characteristics via a SpeechSynthesisVoice variable (syntax 2).
    All the voice characteristics via a SpeechSynthesisVoice variable (syntax 2).
Remark: The use of SpeechSynthesisInitialize is optional. The default parameters will be used if SpeechSynthesisReadText or SpeechSynthesisReadFile is called while the parameters of speech synthesis have not been specified in SpeechSynthesisInitialize.
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 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
iPhone/iPad This function is now available for iPhone/iPad applications.
Example
IF NOT SpeechSynthesisInitialize(NationToLanguage(Nation())) THEN
Error("Failure initializing the speech synthesis.", ErrorInfo())
END
Syntax

Initializing the language only Hide the details

<Result> = SpeechSynthesisInitialize(<Language> [, <Speed>])
<Result>: Boolean
  • True if the initialization was performed,
  • False in case of failure. In this case, the ErrorOccurred variable is set to True. To get the details of the error, use ErrorInfo.
<Language>: Integer or Integer constant
  • Language that will be used to read the text. If the specified language is not supported by the engine for speech synthesis, the function will return False and the first available language will be used according to the following sequence :
    • Language of the application (default language or language defined by Nation).
    • Language of device
    • English
    • Default language of engine for speech synthesis.
  • 0 to use the current application language.
The available constants are as follows:
Versions 16 and later
languageAfrikaans
New in version 16
languageAfrikaans
languageAfrikaans
Afrikaans
languageAlbanianAlbanian
languageGermanGerman
languageEnglishEnglish
languageArabicArabic
languageArmenianArmenian
Versions 16 and later
languageBengali
New in version 16
languageBengali
languageBengali
Bengali
languageBelarusianBelorussian
languageBulgarianBulgarian
Versions 16 and later
languageCatalan
New in version 16
languageCatalan
languageCatalan
Catalan
languageChineseChinese
languageKoreanKorean
languageCroatianCroatian
languageDanishDanish
languageSpanishSpanish
languageEstonianEstonian
languageFinnishFinnish
languageFrenchFrench
languageGeorgianGeorgian
languageGreekGreek
languageHebrewHebrew
Versions 17 and later
languageHindi
New in version 17
languageHindi
languageHindi
Hindi
languageHungarianHungarian
Versions 16 and later
languageIndonesian
New in version 16
languageIndonesian
languageIndonesian
Indonesian
languageIcelandicIcelandic
languageItalianItalian
languageJapaneseJapanese
languageLatvianLatvian
languageLithuanianLithuanian
languageMacedonianMacedonian
languageDutchDutch
languageNorwegianNorwegian
languageUzbekUzbek
Versions 16 and later
languagePunjabi
New in version 16
languagePunjabi
languagePunjabi
Punjabi
languagePolishPolish
languagePortuguesePortuguese
languageRomanianRomanian
languageRussianRussian
languageSerbianSerbian
Versions 16 and later
languageSindhi
New in version 16
languageSindhi
languageSindhi
Sindhi
languageSlovakSlovakian
languageSlovenianSlovenian
languageSwedishSwedish
languageCzechCzech
languageThaiThai
languageTurkishTurkish
languageUkrainianUkrainian
languageVietnameseVietnamese
<Speed>: Optional integer
Speed for reading the text, included between 0 (very slow) and 10 (very fast). If this parameter is not specified, its value will be set to 5 (average speed).
Versions 21 and later
Universal Windows 10 App This parameter is ignored. The reading speed can be defined in the parameters of the mobile device used ("Parameters .. Time and language .. Voice").
New in version 21
Universal Windows 10 App This parameter is ignored. The reading speed can be defined in the parameters of the mobile device used ("Parameters .. Time and language .. Voice").
Universal Windows 10 App This parameter is ignored. The reading speed can be defined in the parameters of the mobile device used ("Parameters .. Time and language .. Voice").
Versions 26 and later

Initializing all the voice characteristics Hide the details

<Result> = SpeechSynthesisInitialize(<Voice> [, <Speed>])
<Result>: Boolean
  • True if the initialization was performed,
  • False in case of failure. In this case, the ErrorOccurred variable is set to True. To get the details of the error, use ErrorInfo.
<Voice>: SpeechSynthesisVoice variable
Name of the SpeechSynthesisVoice variable to be used for reading the text.
<Speed>: Optional integer
Speed for reading the text, included between 0 (very slow) and 10 (very fast). If this parameter is not specified, its value will be set to 5 (average speed).
Versions 21 and later
Universal Windows 10 App This parameter is ignored. The reading speed can be defined in the parameters of the mobile device used ("Parameters .. Time and language .. Voice").
New in version 21
Universal Windows 10 App This parameter is ignored. The reading speed can be defined in the parameters of the mobile device used ("Parameters .. Time and language .. Voice").
Universal Windows 10 App This parameter is ignored. The reading speed can be defined in the parameters of the mobile device used ("Parameters .. Time and language .. Voice").
New in version 26

Initializing all the voice characteristics Hide the details

<Result> = SpeechSynthesisInitialize(<Voice> [, <Speed>])
<Result>: Boolean
  • True if the initialization was performed,
  • False in case of failure. In this case, the ErrorOccurred variable is set to True. To get the details of the error, use ErrorInfo.
<Voice>: SpeechSynthesisVoice variable
Name of the SpeechSynthesisVoice variable to be used for reading the text.
<Speed>: Optional integer
Speed for reading the text, included between 0 (very slow) and 10 (very fast). If this parameter is not specified, its value will be set to 5 (average speed).
Versions 21 and later
Universal Windows 10 App This parameter is ignored. The reading speed can be defined in the parameters of the mobile device used ("Parameters .. Time and language .. Voice").
New in version 21
Universal Windows 10 App This parameter is ignored. The reading speed can be defined in the parameters of the mobile device used ("Parameters .. Time and language .. Voice").
Universal Windows 10 App This parameter is ignored. The reading speed can be defined in the parameters of the mobile device used ("Parameters .. Time and language .. Voice").

Initializing all the voice characteristics Hide the details

<Result> = SpeechSynthesisInitialize(<Voice> [, <Speed>])
<Result>: Boolean
  • True if the initialization was performed,
  • False in case of failure. In this case, the ErrorOccurred variable is set to True. To get the details of the error, use ErrorInfo.
<Voice>: SpeechSynthesisVoice variable
Name of the SpeechSynthesisVoice variable to be used for reading the text.
<Speed>: Optional integer
Speed for reading the text, included between 0 (very slow) and 10 (very fast). If this parameter is not specified, its value will be set to 5 (average speed).
Versions 21 and later
Universal Windows 10 App This parameter is ignored. The reading speed can be defined in the parameters of the mobile device used ("Parameters .. Time and language .. Voice").
New in version 21
Universal Windows 10 App This parameter is ignored. The reading speed can be defined in the parameters of the mobile device used ("Parameters .. Time and language .. Voice").
Universal Windows 10 App This parameter is ignored. The reading speed can be defined in the parameters of the mobile device used ("Parameters .. Time and language .. Voice").
Remarks

Operating mode

  • AndroidAndroid Widget If no engine for speech synthesis is installed on the device, its download will be automatically proposed.
    If the language to be used for speech synthesis is not the system language, this language must be specified in Android's "Text-to-speech Engine" settings. In "Language", replace "Use system language" with the desired language.
  • To synthesize a character string or a text file, use SpeechSynthesisReadText and SpeechSynthesisReadFile respectively.
  • Versions 21 and later
    Universal Windows 10 App Only the engine for speech synthesis corresponding to the default system language is installed. To install another engine for speech synthesis, use the parameter of the device ("Parameters .. Time and language .. Language").
    New in version 21
    Universal Windows 10 App Only the engine for speech synthesis corresponding to the default system language is installed. To install another engine for speech synthesis, use the parameter of the device ("Parameters .. Time and language .. Language").
    Universal Windows 10 App Only the engine for speech synthesis corresponding to the default system language is installed. To install another engine for speech synthesis, use the parameter of the device ("Parameters .. Time and language .. Language").
  • 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.
  • Versions 21 and later
    iPhone/iPad Speech synthesis functions are only available on devices with iOS 7 and higher. The speech synthesis does not operate on the iOS 8 emulators.
    New in version 21
    iPhone/iPad Speech synthesis functions are only available on devices with iOS 7 and higher. The speech synthesis does not operate on the iOS 8 emulators.
    iPhone/iPad Speech synthesis functions are only available on devices with iOS 7 and higher. The speech synthesis does not operate on the iOS 8 emulators.
Versions 21 and later
Universal Windows 10 App Required application feature
When this function is used, an application feature is declared in the application generation wizard.
Required feature: Microphone: This feature allows the applications to perform audio recordings.
New in version 21
Universal Windows 10 App Required application feature
When this function is used, an application feature is declared in the application generation wizard.
Required feature: Microphone: This feature allows the applications to perform audio recordings.
Universal Windows 10 App Required application feature
When this function is used, an application feature is declared in the application generation wizard.
Required feature: Microphone: This feature allows the applications to perform audio recordings.
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.
SpeechSynthesisInitialize 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.
SpeechSynthesisInitialize 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.
SpeechSynthesisInitialize 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.
Business / UI classification: UI Code
Component: wd260android.aar
Minimum version required
  • Version 17
This page is also available for…
Comments
Click [Add] to post a comment