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: README.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ A high-performance text-to-speech library built for bare React Native and Expo,
11
11
</div>
12
12
<br/>
13
13
14
-
> **Only New Architecture**: This library is currently compatible with the new architecture. If you're using React Native 0.76 or higher, it is already enabled. However, if your React Native version is between 0.68 and 0.75, you need to enable it first. [Click here if you need help enabling the new architecture](https://github.com/reactwg/react-native-new-architecture/blob/main/docs/enable-apps.md)
14
+
> **Only New Architecture**: This library is only compatible with the new architecture. If you're using React Native 0.76 or higher, it is already enabled. However, if your React Native version is between 0.68 and 0.75, you need to enable it first. [Click here if you need help enabling the new architecture](https://github.com/reactwg/react-native-new-architecture/blob/main/docs/enable-apps.md)
15
15
16
16
## Preview
17
17
@@ -21,17 +21,19 @@ A high-performance text-to-speech library built for bare React Native and Expo,
21
21
22
22
## Features
23
23
24
-
- 🚀 High-performance library built with Turbo Modules for Android and iOS
24
+
- 🚀 **High Performance** - Built on Turbo Modules for a fast, native-like experience on Android & iOS
25
25
26
-
- 🎛️ Provides essential methods for full control over synthesis
26
+
- 🎛️ **Full Control** - Complete set of methods for comprehensive speech synthesis management
27
27
28
-
- 🪄 Support for the `pause` and `resume`methods—including the `onPause` and `onResume` events—on Android as well. Unlike iOS, which natively provides these features, this library implements its own handling on Android (API26+ required)
28
+
- 🪄 **Consistent Playback** - Offers `pause` and `resume`support for iOS and Android. Since this functionality isn’t natively available on Android, the library provides a custom implementation (API26+) designed to emulate the iOS experience
29
29
30
-
-📡 Offers useful events for more precise control over synthesis
30
+
-🔊 **Optional Audio Ducking** - Automatically lowers other app audio to ensure clear, uninterrupted speech
31
31
32
-
-💅 Includes a customizable [HighlightedText](./docs/USAGE.md#highlightedtext) component to display the currently spoken text
32
+
-📡 **Rich Events** - Comprehensive event system for precise synthesis lifecycle monitoring
33
33
34
-
- ✅ Fully type-safe and written in TypeScript
|`language`|`string`| Language code or IETF BCP 47 language tag (e.g., `'en-US'`, `'fr-FR'`) | Both |
210
+
|`volume`|`number`| Volume level from `0.0` (silent) to `1.0` (maximum) | Both |
211
+
|`voice`|`string`| Specific voice identifier to use (obtained from `getAvailableVoices()`) | Both |
212
+
|`pitch`|`number`| Pitch multiplier: Android `0.1`–`2.0`, iOS `0.5`–`2.0`| Both |
213
+
|`rate`|`number`| Speech rate: Android `0.1`–`2.0`, iOS varies based on `AVSpeechUtterance` limits | Both |
214
+
|`ducking`|`boolean`| If `true`, temporarily lowers audio from other apps while speech is active. Defaults to `false`| Both |
215
+
|`silentMode`|`'obey' \| 'respect' \| 'ignore'`| Controls how speech interacts with the device's silent switch. Ignored if `ducking` is `true`| iOS only |
216
+
217
+
**silentMode Options (iOS only):**
218
+
219
+
-**`obey`** (default): Does not change the app's audio session. Speech follows the system default behavior.
220
+
-**`respect`**: Speech will be silenced by the ringer switch. Use for non-critical audio content.
221
+
-**`ignore`**: Speech will play even if the ringer is off. Use for critical audio when ducking is not desired.
133
222
134
223
**Example Usage:**
135
224
@@ -139,6 +228,8 @@ Speech.initialize({
139
228
volume: 1.0,
140
229
pitch: 1.2,
141
230
rate: 0.8,
231
+
ducking: false,
232
+
silentMode: 'obey', // iOS only; ignored if ducking is true
142
233
});
143
234
```
144
235
@@ -336,7 +427,7 @@ stoppedSubscription.remove();
336
427
337
428
**Callback Parameters:**
338
429
339
-
-`id`: The uttenrance identifier
430
+
-`id`: The utterance identifier
340
431
-`length`: The text being spoken length
341
432
-`location`: The current position in the spoken text
0 commit comments