Skip to content

Instantly share code, notes, and snippets.

@JoaoCnh
Created July 5, 2017 22:20
Show Gist options
  • Save JoaoCnh/517105e6b4e092c1ffe5c660e6b89b03 to your computer and use it in GitHub Desktop.
Save JoaoCnh/517105e6b4e092c1ffe5c660e6b89b03 to your computer and use it in GitHub Desktop.
react-native-android-voice example
// Import the package
import SpeechAndroid from 'react-native-android-voice';
...
async _buttonClick() {
try{
// THIS EASY!
var spokenText = await SpeechAndroid.startSpeech("Speak into the Mic!", SpeechAndroid.GERMAN);
ToastAndroid.show(spokenText , ToastAndroid.LONG);
}catch(error){
// DO WHATEVER YOU WANT WITH THE PACKAGE ERROR CODES
}
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment