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
Copy file name to clipboardExpand all lines: docs/docs/06-api-reference/classes/ResourceFetcher.md
+6-6Lines changed: 6 additions & 6 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: ResourceFetcher
2
2
3
-
Defined in: [utils/ResourceFetcher.ts:53](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L53)
3
+
Defined in: [utils/ResourceFetcher.ts:83](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L83)
4
4
5
5
This module provides functions to download and work with downloaded files stored in the application's document directory inside the `react-native-executorch/` directory.
6
6
These utilities can help you manage your storage and clean up the downloaded files when they are no longer needed.
@@ -21,7 +21,7 @@ These utilities can help you manage your storage and clean up the downloaded fil
21
21
22
22
> `static`**fs**: `object`
23
23
24
-
Defined in: [utils/ResourceFetcher.ts:128](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L128)
24
+
Defined in: [utils/ResourceFetcher.ts:158](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L158)
25
25
26
26
Filesystem utilities for reading downloaded resources.
27
27
@@ -60,7 +60,7 @@ Currently supports reading file contents as strings for configuration files.
Defined in: [utils/ResourceFetcher.ts:105](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L105)
63
+
Defined in: [utils/ResourceFetcher.ts:135](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L135)
64
64
65
65
Fetches resources (remote URLs, local files or embedded assets), downloads or stores them locally for use by React Native ExecuTorch.
66
66
@@ -91,7 +91,7 @@ If the fetch was interrupted, it returns a promise which resolves to `null`.
Defined in: [utils/ResourceFetcher.ts:87](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L87)
94
+
Defined in: [utils/ResourceFetcher.ts:117](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L117)
95
95
96
96
Gets the current resource fetcher adapter instance.
97
97
@@ -115,7 +115,7 @@ If no adapter has been set via [setAdapter](#setadapter).
115
115
116
116
> `static`**resetAdapter**(): `void`
117
117
118
-
Defined in: [utils/ResourceFetcher.ts:74](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L74)
118
+
Defined in: [utils/ResourceFetcher.ts:104](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L104)
119
119
120
120
Resets the resource fetcher adapter to null.
121
121
@@ -133,7 +133,7 @@ Resets the resource fetcher adapter to null.
133
133
134
134
> `static`**setAdapter**(`adapter`): `void`
135
135
136
-
Defined in: [utils/ResourceFetcher.ts:64](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L64)
136
+
Defined in: [utils/ResourceFetcher.ts:94](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L94)
137
137
138
138
Sets a custom resource fetcher adapter for resource operations.
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)
Copy file name to clipboardExpand all lines: docs/docs/06-api-reference/interfaces/ResourceFetcherAdapter.md
+3-3Lines changed: 3 additions & 3 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: ResourceFetcherAdapter
2
2
3
-
Defined in: [utils/ResourceFetcher.ts:18](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L18)
3
+
Defined in: [utils/ResourceFetcher.ts:48](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L48)
4
4
5
5
Adapter interface for resource fetching operations.
6
6
**Required Methods:**
@@ -19,7 +19,7 @@ these two methods for the library to function correctly.
Defined in: [utils/ResourceFetcher.ts:30](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L30)
22
+
Defined in: [utils/ResourceFetcher.ts:60](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L60)
23
23
24
24
Fetches resources (remote URLs, local files or embedded assets), downloads or stores them locally for use by React Native ExecuTorch.
25
25
@@ -54,7 +54,7 @@ If the fetch was interrupted, it returns a promise which resolves to `null`.
54
54
55
55
> **readAsString**(`path`): `Promise`\<`string`\>
56
56
57
-
Defined in: [utils/ResourceFetcher.ts:44](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L44)
57
+
Defined in: [utils/ResourceFetcher.ts:74](https://github.com/software-mansion/react-native-executorch/blob/main/packages/react-native-executorch/src/utils/ResourceFetcher.ts#L74)
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