You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defined in: [modules/natural_language_processing/TextEmbeddingsModule.ts:60](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextEmbeddingsModule.ts#L60)
139
+
Defined in: [modules/natural_language_processing/TextEmbeddingsModule.ts:63](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextEmbeddingsModule.ts#L63)
140
140
141
141
Executes the model's forward pass, where `input` is a text that will be embedded.
Copy file name to clipboardExpand all lines: docs/docs/06-api-reference/classes/TextToSpeechModule.md
+64-7Lines changed: 64 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Class: TextToSpeechModule
2
2
3
-
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:17](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L17)
3
+
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:18](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L18)
4
4
5
5
Module for Text to Speech (TTS) functionalities.
6
6
@@ -20,7 +20,7 @@ Module for Text to Speech (TTS) functionalities.
20
20
21
21
> **nativeModule**: `any` = `null`
22
22
23
-
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:21](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L21)
23
+
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:22](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L22)
24
24
25
25
Native module instance
26
26
@@ -30,7 +30,7 @@ Native module instance
30
30
31
31
> **delete**(): `void`
32
32
33
-
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:182](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L182)
33
+
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:229](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L229)
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:109](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L109)
47
+
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:118](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L118)
48
48
49
49
Synthesizes the provided text into speech.
50
50
Returns a promise that resolves to the full audio waveform as a `Float32Array`.
@@ -71,11 +71,43 @@ A promise resolving to the synthesized audio waveform.
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:135](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L135)
79
+
80
+
Synthesizes pre-computed phonemes into speech, bypassing the built-in phonemizer.
81
+
This allows using an external G2P system (e.g. the Python `phonemizer` library,
82
+
espeak-ng, or any custom phonemizer).
83
+
84
+
#### Parameters
85
+
86
+
##### phonemes
87
+
88
+
`string`
89
+
90
+
The pre-computed IPA phoneme string.
91
+
92
+
##### speed?
93
+
94
+
`number` = `1.0`
95
+
96
+
Optional speed multiplier for the speech synthesis (default is 1.0).
97
+
98
+
#### Returns
99
+
100
+
`Promise`\<`Float32Array`\<`ArrayBufferLike`\>\>
101
+
102
+
A promise resolving to the synthesized audio waveform.
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:30](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L30)
110
+
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:31](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L31)
79
111
80
112
Loads the model and voice assets specified by the config object.
81
113
`onDownloadProgressCallback` allows you to monitor the current progress.
@@ -104,7 +136,7 @@ Optional callback to monitor download progress.
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:127](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L127)
139
+
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:196](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L196)
108
140
109
141
Starts a streaming synthesis session. Yields audio chunks as they are generated.
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:210](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L210)
164
+
165
+
Starts a streaming synthesis session from pre-computed phonemes.
166
+
Bypasses the built-in phonemizer, allowing use of external G2P systems.
An async generator yielding Float32Array audio chunks.
181
+
182
+
---
183
+
127
184
### streamStop()
128
185
129
186
> **streamStop**(): `void`
130
187
131
-
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:175](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L175)
188
+
Defined in: [modules/natural_language_processing/TextToSpeechModule.ts:222](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/modules/natural_language_processing/TextToSpeechModule.ts#L222)
132
189
133
190
Stops the streaming process if there is any ongoing.
Defined in: [hooks/natural_language_processing/useTextToSpeech.ts:19](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/hooks/natural_language_processing/useTextToSpeech.ts#L19)
5
+
Defined in: [hooks/natural_language_processing/useTextToSpeech.ts:22](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/hooks/natural_language_processing/useTextToSpeech.ts#L22)
Defined in: [types/tts.ts:103](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L103)
4
+
5
+
Text to Speech module input for pre-computed phonemes.
6
+
Use this when you have your own phonemizer (e.g. the Python `phonemizer`
7
+
library, espeak-ng, or any custom G2P system) and want to bypass the
Defined in: [types/tts.ts:104](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L104)
21
+
22
+
pre-computed IPA phoneme string
23
+
24
+
---
25
+
26
+
### speed?
27
+
28
+
> `optional`**speed**: `number`
29
+
30
+
Defined in: [types/tts.ts:105](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L105)
31
+
32
+
optional speed argument - the higher it is, the faster the speech becomes
Defined in: [types/tts.ts:189](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L189)
4
+
5
+
Shared streaming lifecycle callbacks for TTS streaming modes.
Defined in: [types/tts.ts:190](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L190)
Defined in: [types/tts.ts:192](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L192)
Defined in: [types/tts.ts:191](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L191)
Copy file name to clipboardExpand all lines: docs/docs/06-api-reference/interfaces/TextToSpeechStreamingInput.md
+17-5Lines changed: 17 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Interface: TextToSpeechStreamingInput
2
2
3
-
Defined in: [types/tts.ts:156](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L156)
3
+
Defined in: [types/tts.ts:205](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L205)
4
4
5
5
Text to Speech streaming input definition
6
6
@@ -11,43 +11,51 @@ Callbacks can be both synchronous or asynchronous.
Defined in: [types/tts.ts:157](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L157)
22
+
Defined in: [types/tts.ts:190](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L190)
Defined in: [types/tts.ts:159](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L159)
40
+
Defined in: [types/tts.ts:192](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L192)
Defined in: [types/tts.ts:158](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L158)
58
+
Defined in: [types/tts.ts:191](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/types/tts.ts#L191)
51
59
52
60
Called after each audio chunk gets calculated.
53
61
@@ -61,6 +69,10 @@ Called after each audio chunk gets calculated.
0 commit comments