Learning with Texts - Fork  2.10.0-fork
Learn foreign languages with texts
Namespaces | Functions | Variables
text_to_speech_settings.php File Reference

Utility for calling system speech synthesizer. More...

Namespaces

 Lwt
 

Functions

 get_language_code ($language)
 
 language_id_from_code ($code)
 
 tts_language_options ()
 
 tts_settings_form ()
 
 tts_demo ()
 
 tts_settings_minimal_page ()
 
 tts_settings_full_page ($message)
 
 tts_save_settings ($form)
 

Variables

 $message = ''
 

Detailed Description

Utility for calling system speech synthesizer.

PHP version 8.1

Function Documentation

◆ get_language_code()

get_language_code (   $language)

Two-letter language code from from language name (e. g. : "English" = > "en" ).

Parameters
string$languageLanguage name, for instance "English"
Returns
string Two-letter language name

@ðeprecated Since 2.9.1-fork, use getLanguageCode

◆ language_id_from_code()

language_id_from_code (   $code)

Return the language ID from a two-letter language code or a BCP 47 tag.

If two languages have the same country name, only thte first one will be returned.

Parameters
string$codeTwo letters, or four letters separated with caret ("fr" or "en-US").
Returns
int Language ID if found, -1 otherwise.

◆ tts_demo()

tts_demo ( )

Prepare a demo for TTS.

Returns
void

◆ tts_language_options()

tts_language_options ( )

String to population a SELECT tag.

Returns
string HTML-formatted string.

◆ tts_save_settings()

tts_save_settings (   $form)

Save the text-to-speech settings as cookies.

Parameters
array$formInputs from the main form.
Returns
void

◆ tts_settings_form()

tts_settings_form ( )

Prepare a from for all the TTS settings.

Returns
void

◆ tts_settings_full_page()

tts_settings_full_page (   $message)

Make the complete HTML page for text-to-speech settings.

Parameters
string$messageA message to display when page loads.
Returns
void

◆ tts_settings_minimal_page()

tts_settings_minimal_page ( )

Make only a partial, embedable page for text-to-speech settings.

Returns
void