Last active
January 27, 2018 15:29
-
-
Save gaving/2176539430a44abec02aee0e45566102 to your computer and use it in GitHub Desktop.
expo Speech SDK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_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