|
1032 | 1032 | [b]Note:[/b] This method is implemented on Android, iOS, UWP, and HTML5.
|
1033 | 1033 | </description>
|
1034 | 1034 | </method>
|
| 1035 | + <method name="tts_get_voices" qualifiers="const"> |
| 1036 | + <return type="Array" /> |
| 1037 | + <description> |
| 1038 | + Returns an [Array] of voice information dictionaries. |
| 1039 | + Each [Dictionary] contains two [String] entries: |
| 1040 | + - [code]name[/code] is voice name. |
| 1041 | + - [code]id[/code] is voice identifier. |
| 1042 | + - [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. |
| 1043 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1044 | + </description> |
| 1045 | + </method> |
| 1046 | + <method name="tts_get_voices_for_language" qualifiers="const"> |
| 1047 | + <return type="PoolStringArray" /> |
| 1048 | + <argument index="0" name="language" type="String" /> |
| 1049 | + <description> |
| 1050 | + Returns an [PoolStringArray] of voice identifiers for the [code]language[/code]. |
| 1051 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1052 | + </description> |
| 1053 | + </method> |
| 1054 | + <method name="tts_is_paused" qualifiers="const"> |
| 1055 | + <return type="bool" /> |
| 1056 | + <description> |
| 1057 | + Returns [code]true[/code] if the synthesizer is in a paused state. |
| 1058 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1059 | + </description> |
| 1060 | + </method> |
| 1061 | + <method name="tts_is_speaking" qualifiers="const"> |
| 1062 | + <return type="bool" /> |
| 1063 | + <description> |
| 1064 | + Returns [code]true[/code] if the synthesizer is generating speech, or have utterance waiting in the queue. |
| 1065 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1066 | + </description> |
| 1067 | + </method> |
| 1068 | + <method name="tts_pause"> |
| 1069 | + <return type="void" /> |
| 1070 | + <description> |
| 1071 | + Puts the synthesizer into a paused state. |
| 1072 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1073 | + </description> |
| 1074 | + </method> |
| 1075 | + <method name="tts_resume"> |
| 1076 | + <return type="void" /> |
| 1077 | + <description> |
| 1078 | + Resumes the synthesizer if it was paused. |
| 1079 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1080 | + </description> |
| 1081 | + </method> |
| 1082 | + <method name="tts_set_utterance_callback"> |
| 1083 | + <return type="void" /> |
| 1084 | + <argument index="0" name="event" type="int" enum="OS.TTSUtteranceEvent" /> |
| 1085 | + <argument index="1" name="object" type="Object" /> |
| 1086 | + <argument index="2" name="callback" type="String" /> |
| 1087 | + <description> |
| 1088 | + Adds a callback, which is called when the utterance has started, finished, canceled or reached a text boundary. |
| 1089 | + - [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. |
| 1090 | + - [code]TTS_UTTERANCE_BOUNDARY[/code] callable's method should take two [int] parameters, the index of the character and the utterance id. |
| 1091 | + [b]Note:[/b] The granularity of the boundary callbacks is engine dependent. |
| 1092 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1093 | + </description> |
| 1094 | + </method> |
| 1095 | + <method name="tts_speak"> |
| 1096 | + <return type="void" /> |
| 1097 | + <argument index="0" name="text" type="String" /> |
| 1098 | + <argument index="1" name="voice" type="String" /> |
| 1099 | + <argument index="2" name="volume" type="int" default="50" /> |
| 1100 | + <argument index="3" name="pitch" type="float" default="1.0" /> |
| 1101 | + <argument index="4" name="rate" type="float" default="1.0" /> |
| 1102 | + <argument index="5" name="utterance_id" type="int" default="0" /> |
| 1103 | + <argument index="6" name="interrupt" type="bool" default="false" /> |
| 1104 | + <description> |
| 1105 | + Adds an utterance to the queue. If [code]interrupt[/code] is [code]true[/code], the queue is cleared first. |
| 1106 | + - [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]. |
| 1107 | + - [code]volume[/code] ranges from [code]0[/code] (lowest) to [code]100[/code] (highest). |
| 1108 | + - [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. |
| 1109 | + - [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. |
| 1110 | + - [code]utterance_id[/code] is passed as a parameter to the callback functions. |
| 1111 | + [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]. |
| 1112 | + [b]Note:[/b] The granularity of pitch, rate, and volume is engine and voice dependent. Values may be truncated. |
| 1113 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1114 | + </description> |
| 1115 | + </method> |
| 1116 | + <method name="tts_stop"> |
| 1117 | + <return type="void" /> |
| 1118 | + <description> |
| 1119 | + Stops synthesis in progress and removes all utterances from the queue. |
| 1120 | + [b]Note:[/b] This method is implemented on Android, iOS, HTML5, Linux, macOS, and Windows. |
| 1121 | + </description> |
| 1122 | + </method> |
1035 | 1123 | </methods>
|
1036 | 1124 | <members>
|
1037 | 1125 | <member name="clipboard" type="String" setter="set_clipboard" getter="get_clipboard" default="""">
|
|
1283 | 1371 | <constant name="POWERSTATE_CHARGED" value="4" enum="PowerState">
|
1284 | 1372 | Plugged in, battery fully charged.
|
1285 | 1373 | </constant>
|
| 1374 | + <constant name="TTS_UTTERANCE_STARTED" value="0" enum="TTSUtteranceEvent"> |
| 1375 | + Utterance has begun to be spoken. |
| 1376 | + </constant> |
| 1377 | + <constant name="TTS_UTTERANCE_ENDED" value="1" enum="TTSUtteranceEvent"> |
| 1378 | + Utterance was successfully finished. |
| 1379 | + </constant> |
| 1380 | + <constant name="TTS_UTTERANCE_CANCELED" value="2" enum="TTSUtteranceEvent"> |
| 1381 | + Utterance was canceled, or TTS service was unable to process it. |
| 1382 | + </constant> |
| 1383 | + <constant name="TTS_UTTERANCE_BOUNDARY" value="3" enum="TTSUtteranceEvent"> |
| 1384 | + Utterance reached a word or sentence boundary. |
| 1385 | + </constant> |
1286 | 1386 | </constants>
|
1287 | 1387 | </class>
|
0 commit comments