Skip to content

de-code/react-native-web-speech-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web Speech API for React Native

This module attempts to provide the Web Speech API for React Native.

The main purpose of the module is allow common web and pre-existing code to use the Web Speech API.

This is currently in a very early stage:

Installation

npm install react-native-web-speech-api

Dependencies

react-native-android-speech-recognizer is used to provide the Android React Native module.

Please follow its installation instructions.

Usage

import {
  isSpeechRecognitionSupported,
  SpeechRecognition
} from 'react-native-web-speech-api';

if (isSpeechRecognitionSupported()) {
  const recognition = new SpeechRecognition();
  recognition.onerror = event =>
    console.log("Error:", event.error);
  recognition.onresult = event =>
    console.log("Result:", event.results[0][0].transcript);
  recognition.start();
}

About

Web Speech API for React Native

Resources

License

Stars

Watchers

Forks

Packages

No packages published