react-native-stt
react-native-stt is a speech-to-text library for React Native.
This project combines the works of react-native-speech-to-text-ios and react-native-android-speech-recognizer.
Documentation
Install
npm install --save react-native-sttreact-native link react-native-stt
Manual
Android
- Open up
MainApplication.java
- Import
com.deadmau.rnspeechtotext.RNSpeechToTextPackage;
- Add
new RNSpeechToTextPackage()
to thegetPackages()
method
- Insert the following lines in
android/settings.gradle
:
include ':react-native-stt'
project(':react-native-stt').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-stt/android/lib')
- Insert the following lines in
android/app/build.gradle
:
compile project(':react-native-stt')
Usage
Imports
;
Listening
Sets locale & emits speech-to-text result. If locale is not set, it will start with device default locale.
Sttstart'en-US';
Stops speech recognition (but, it will process the last data it received).
Stt;
Destroys Stt.
Stt;
List Locales
Returns list of available languages
...Stt;...Stt; // Prints://// en-GB,// ...// uk-UA
License
MIT