react-native-tts
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -28,3 +28,3 @@ import { NativeModules, NativeEventEmitter, Platform } from 'react-native'; | ||
} | ||
return TextToSpeech.requestInstallData(); | ||
return TextToSpeech.requestInstallData(); | ||
} | ||
@@ -52,2 +52,8 @@ | ||
setIgnoreSilentSwitch(ignoreSilentSwitch) { | ||
if (Platform.OS === "ios" && ignoreSilentSwitch) { | ||
return TextToSpeech.setIgnoreSilentSwitch(ignoreSilentSwitch); | ||
} | ||
} | ||
voices() { | ||
@@ -54,0 +60,0 @@ return TextToSpeech.voices(); |
{ | ||
"name": "react-native-tts", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "React Native Text-To-Speech module for Android and iOS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -10,2 +10,3 @@ # React Native TTS | ||
- [License](#license) | ||
- [Example project](#example) | ||
@@ -16,3 +17,3 @@ ## Install | ||
npm install --save react-native-tts | ||
react-native link | ||
react-native link react-native-tts | ||
``` | ||
@@ -45,3 +46,3 @@ | ||
- `KEY_PARAM_PAN` ranges from `-1` to `+1`. | ||
- `KEY_PARAM_PAN` ranges from `-1` to `+1`. | ||
@@ -80,3 +81,3 @@ - `KEY_PARAM_VOLUME` ranges from `0` to `1`, where 0 means silence. Note that `1` is a default value for Android. | ||
Returns list of available voices | ||
Returns list of available voices | ||
@@ -114,3 +115,3 @@ *(not supported on Android API Level < 21, returns empty list)* | ||
Sets default voice, pass one of the voiceId as reported by a call to Tts.voices() | ||
Sets default voice, pass one of the voiceId as reported by a call to Tts.voices() | ||
@@ -147,2 +148,14 @@ *(not available on Android API Level < 21)* | ||
### Controls the iOS silent switch behavior | ||
Platforms: iOS | ||
- "inherit" (default) - Use the default behavior | ||
- "ignore" - Play audio even if the silent switch is set | ||
- "obey" - Don't play audio if the silent switch is set | ||
```js | ||
Tts.setIgnoreSilentSwitch("ignore"); | ||
``` | ||
### Events | ||
@@ -185,2 +198,6 @@ | ||
## Example | ||
There is an example project which shows use of react-native-tts on Android/iOS: https://github.com/themostaza/react-native-tts-example | ||
## License | ||
@@ -187,0 +204,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
92063
90
223