How to use expo-speech - 6 common examples

To help you get started, we’ve selected a few expo-speech examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo / apps / native-component-list / src / screens / TextToSpeechScreen.tsx View on Github external
_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,
    });
  }
github SCasarotto / casarotto-chat / src / pages / Main / Main.js View on Github external
(buttonIndex) => {
					switch (buttonIndex) {
						case 0:
							Speech.speak(currentMessage.text)
							break
						case 1:
							Clipboard.setString(currentMessage.text)
							break
					}
				},
			)
github expo / expo / apps / native-component-list / src / screens / TextToSpeechScreen.tsx View on Github external
_loadAllVoices = async () => {
    const availableVoices = await Speech.getAvailableVoicesAsync();
    this.setState({
      voiceList: availableVoices,
      voice: availableVoices[0].identifier,
    });
  }
github expo / expo / apps / native-component-list / src / screens / TextToSpeechScreen.tsx View on Github external
_pause = async () => {
    await Speech.pause();
    this.setState({ paused: true });
  }
github expo / expo / apps / native-component-list / src / screens / TextToSpeechScreen.tsx View on Github external
_resume = () => {
    Speech.resume();
    this.setState({ paused: false });
  }

expo-speech

Provides text-to-speech functionality.

MIT
Latest version published 1 day ago

Package Health Score

84 / 100
Full package analysis