🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-native-stt

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-stt

React Native extension for speech-to-text

0.0.2
latest
Source
npm
Version published
Maintainers
1
Created
Source

react-native-stt

DUB

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-stt
react-native link react-native-stt

Manual

Android

  • Open up MainApplication.java
  • Import com.deadmau.rnspeechtotext.RNSpeechToTextPackage;
  • Add new RNSpeechToTextPackage() to the getPackages() 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

import Stt from 'react-native-stt';

Listening

Sets locale & emits speech-to-text result. If locale is not set, it will start with device default locale.

Stt.start('en-US');

Stops speech recognition (but, it will process the last data it received).

Stt.stop();

Destroys Stt.

Stt.destroy();

List Locales

Returns list of available languages

...
Stt.supportedLocales();
...
Stt.addListener('supportedLocales', (result) => {
  if (result.error) {
    alert(JSON.stringify(result.error));
  } else {
    if (Platform.os === 'android') {
      console.log(result.supportedLanguages);
    } else{
      console.log(result);
    }
  }
});

// Prints:
//
// en-GB,
// ...
// uk-UA

License

MIT

Keywords

react-native

FAQs

Package last updated on 20 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts