react-native-tts
Advanced tools
Comparing version 3.0.0 to 3.1.0
16
index.js
@@ -35,2 +35,9 @@ import { NativeModules, NativeEventEmitter, Platform } from 'react-native'; | ||
setDefaultEngine(engineName) { | ||
if (Platform.OS === 'ios') { | ||
return Promise.resolve(true); | ||
} | ||
return TextToSpeech.setDefaultEngine(engineName); | ||
} | ||
setDefaultVoice(voiceId) { | ||
@@ -53,3 +60,3 @@ return TextToSpeech.setDefaultVoice(voiceId); | ||
setIgnoreSilentSwitch(ignoreSilentSwitch) { | ||
if (Platform.OS === "ios" && ignoreSilentSwitch) { | ||
if (Platform.OS === 'ios' && ignoreSilentSwitch) { | ||
return TextToSpeech.setIgnoreSilentSwitch(ignoreSilentSwitch); | ||
@@ -63,2 +70,9 @@ } | ||
engines() { | ||
if (Platform.OS === 'ios') { | ||
return Promise.resolve(true); | ||
} | ||
return TextToSpeech.engines(); | ||
} | ||
speak(utterance, options = {}) { | ||
@@ -65,0 +79,0 @@ // compatibility with old-style voiceId argument passing |
{ | ||
"name": "react-native-tts", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "React Native Text-To-Speech module for Android and iOS", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -165,2 +165,13 @@ # React Native TTS | ||
### Support for multiple TTS engines | ||
Platforms: Android | ||
Functions to list available TTS engines and set an engine to use. | ||
```js | ||
Tts.engines().then(engines => console.log(engines)); | ||
Tts.setDefaultEngine('engineName'); | ||
``` | ||
### Install (additional) language data | ||
@@ -167,0 +178,0 @@ |
Sorry, the diff of this file is not supported yet
96736
102
234