Skip to content

Commit

Permalink
Document API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ak1394 committed Jan 30, 2018
1 parent 13724d5 commit a5e9afd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,32 @@ Add utterance to TTS queue and start speaking. Returns promise with utteranceId.
```js
Tts.speak('Hello, world!');
```

Additionally, speak() allows to pass platform-specific options 'voiceId' on IOS and 'params' on Android to underlying platform API:

```js
Tts.speak('Hello, world!', { iosVoiceId: 'com.apple.ttsbundle.Moira-compact' });
Tts.speak('Hello, world!', { androidParams: { KEY_PARAM_PAN: -1, KEY_PARAM_VOLUME: 0.5 } });
```

Stop speaking and flush the TTS queue.

```js
Tts.stop();
```

### Waiting for initialization

On some platforms it could take some time to initialize TTS engine, and Tts.speak() will fail to speak until the engine is ready.

To wait for successfull initialization you could use getInitStatus() call.

```js
Tts.getInitStatus().then(() => {
Tts.speak('Hello, world!');
});
```

### Ducking

Enable lowering other applications output level while speaking (also referred to as "ducking").
Expand Down

0 comments on commit a5e9afd

Please sign in to comment.