Skip to content

Instantly share code, notes, and snippets.

@gaving
Last active January 27, 2018 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaving/2176539430a44abec02aee0e45566102 to your computer and use it in GitHub Desktop.
Save gaving/2176539430a44abec02aee0e45566102 to your computer and use it in GitHub Desktop.
expo Speech SDK
_speak = (language, text) => {
const { pitch, rate } = this.state;
const start = () => {
this.setState({ inProgress: true });
};
const complete = () => {
this.state.inProgress && this.setState({ inProgress: false });
};
Speech.speak(text, {
language,
pitch,
rate,
onStart: start,
onDone: complete,
onStopped: complete,
onError: complete
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment