Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_speak = () => {
const start = () => {
this.setState({ inProgress: true });
};
const complete = () => {
this.state.inProgress &&
this.setState({ inProgress: false, paused: false });
};
Speech.speak(this.state.selectedExample.text, {
voice: this.state.voice,
language: this.state.selectedExample.language,
pitch: this.state.pitch,
rate: this.state.rate,
onStart: start,
onDone: complete,
onStopped: complete,
onError: complete,
});
}
(buttonIndex) => {
switch (buttonIndex) {
case 0:
Speech.speak(currentMessage.text)
break
case 1:
Clipboard.setString(currentMessage.text)
break
}
},
)