|
1020 | 1020 | [b]Note:[/b] This method is implemented on Android, iOS and UWP.
|
1021 | 1021 | </description>
|
1022 | 1022 | </method>
|
| 1023 | + <method name="tts_get_voices" qualifiers="const"> |
| 1024 | + <return type="Array" /> |
| 1025 | + <description> |
| 1026 | + Returns an [Array] of voice information dictionaries. |
| 1027 | + Each [Dictionary] contains two [String] entries: |
| 1028 | + - [code]name[/code] is voice name. |
| 1029 | + - [code]id[/code] is voice identifier. |
| 1030 | + - [code]language[/code] is language code in [code]lang_Variant[/code] format. [code]lang[/code] part is a 2 or 3-letter code based on the ISO-639 standard, in lowercase. And [code]Variant[/code] part is an engine dependent string describing country, region or/and dialect. |
| 1031 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1032 | + </description> |
| 1033 | + </method> |
| 1034 | + <method name="tts_get_voices_for_language" qualifiers="const"> |
| 1035 | + <return type="PoolStringArray" /> |
| 1036 | + <argument index="0" name="language" type="String" /> |
| 1037 | + <description> |
| 1038 | + Returns an [PoolStringArray] of voice identifiers for the [code]language[/code]. |
| 1039 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1040 | + </description> |
| 1041 | + </method> |
| 1042 | + <method name="tts_is_paused" qualifiers="const"> |
| 1043 | + <return type="bool" /> |
| 1044 | + <description> |
| 1045 | + Returns [code]true[/code] if the synthesizer is in a paused state. |
| 1046 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1047 | + </description> |
| 1048 | + </method> |
| 1049 | + <method name="tts_is_speaking" qualifiers="const"> |
| 1050 | + <return type="bool" /> |
| 1051 | + <description> |
| 1052 | + Returns [code]true[/code] if the synthesizer is generating speech, or have utterance waiting in the queue. |
| 1053 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1054 | + </description> |
| 1055 | + </method> |
| 1056 | + <method name="tts_pause"> |
| 1057 | + <return type="void" /> |
| 1058 | + <description> |
| 1059 | + Puts the synthesizer into a paused state. |
| 1060 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1061 | + </description> |
| 1062 | + </method> |
| 1063 | + <method name="tts_resume"> |
| 1064 | + <return type="void" /> |
| 1065 | + <description> |
| 1066 | + Resumes the synthesizer if it was paused. |
| 1067 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1068 | + </description> |
| 1069 | + </method> |
| 1070 | + <method name="tts_set_utterance_callback"> |
| 1071 | + <return type="void" /> |
| 1072 | + <argument index="0" name="event" type="int" enum="OS.TTSUtteranceEvent" /> |
| 1073 | + <argument index="1" name="object" type="Object" /> |
| 1074 | + <argument index="2" name="callback" type="String" /> |
| 1075 | + <description> |
| 1076 | + Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary. |
| 1077 | + - [code]TTS_UTTERANCE_STARTED[/code], [code]TTS_UTTERANCE_ENDED[/code], and [code]TTS_UTTERANCE_CANCELED[/code] callable's method should take one [int] parameter, the utterance id. |
| 1078 | + - [code]TTS_UTTERANCE_BOUNDARY[/code] callable's method should take two [int] parameters, the index of the character and the utterance id. |
| 1079 | + [b]Note:[/b] The granularity of the boundary callbacks is engine dependent. |
| 1080 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1081 | + </description> |
| 1082 | + </method> |
| 1083 | + <method name="tts_speak"> |
| 1084 | + <return type="void" /> |
| 1085 | + <argument index="0" name="text" type="String" /> |
| 1086 | + <argument index="1" name="voice" type="String" /> |
| 1087 | + <argument index="2" name="volume" type="int" default="50" /> |
| 1088 | + <argument index="3" name="pitch" type="float" default="1.0" /> |
| 1089 | + <argument index="4" name="rate" type="float" default="1.0" /> |
| 1090 | + <argument index="5" name="utterance_id" type="int" default="0" /> |
| 1091 | + <argument index="6" name="interrupt" type="bool" default="false" /> |
| 1092 | + <description> |
| 1093 | + Adds an utterance to the queue. If [code]interrupt[/code] is [code]true[/code], the queue is cleared first. |
| 1094 | + - [code]voice[/code] identifier is one of the [code]"id"[/code] values returned by [method tts_get_voices] or one of the values returned by [method tts_get_voices_for_language]. |
| 1095 | + - [code]volume[/code] ranges from [code]0[/code] (lowest) to [code]100[/code] (highest). |
| 1096 | + - [code]pitch[/code] ranges from [code]0.0[/code] (lowest) to [code]2.0[/code] (highest), [code]1.0[/code] is default pitch for the current voice. |
| 1097 | + - [code]rate[/code] ranges from [code]0.1[/code] (lowest) to [code]10.0[/code] (highest), [code]1.0[/code] is a normal speaking rate. Other values act as a percentage relative. |
| 1098 | + - [code]utterance_id[/code] is passed as a parameter to the callback functions. |
| 1099 | + [b]Note:[/b] On Windows and Linux, utterance [code]text[/code] can use SSML markup. SSML support is engine and voice dependent. If the engine does not support SSML, you should strip out all XML markup before calling [method tts_speak]. |
| 1100 | + [b]Note:[/b] The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated. |
| 1101 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1102 | + </description> |
| 1103 | + </method> |
| 1104 | + <method name="tts_stop"> |
| 1105 | + <return type="void" /> |
| 1106 | + <description> |
| 1107 | + Stops synthesis in progress and removes all utterances from the queue. |
| 1108 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1109 | + </description> |
| 1110 | + </method> |
1023 | 1111 | </methods>
|
1024 | 1112 | <members>
|
1025 | 1113 | <member name="clipboard" type="String" setter="set_clipboard" getter="get_clipboard" default="""">
|
|
1246 | 1334 | <constant name="POWERSTATE_CHARGED" value="4" enum="PowerState">
|
1247 | 1335 | Plugged in, battery fully charged.
|
1248 | 1336 | </constant>
|
| 1337 | + <constant name="TTS_UTTERANCE_STARTED" value="0" enum="TTSUtteranceEvent"> |
| 1338 | + Utterance has begun to be spoken. |
| 1339 | + </constant> |
| 1340 | + <constant name="TTS_UTTERANCE_ENDED" value="1" enum="TTSUtteranceEvent"> |
| 1341 | + Utterance was successfully finished. |
| 1342 | + </constant> |
| 1343 | + <constant name="TTS_UTTERANCE_CANCELED" value="2" enum="TTSUtteranceEvent"> |
| 1344 | + Utterance was canceled, or TTS service was unable to process it. |
| 1345 | + </constant> |
| 1346 | + <constant name="TTS_UTTERANCE_BOUNDARY" value="3" enum="TTSUtteranceEvent"> |
| 1347 | + Utterance reached a word or sentence boundary. |
| 1348 | + </constant> |
1249 | 1349 | </constants>
|
1250 | 1350 | </class>
|
0 commit comments