Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Speech to Text

I am making a language app that records any new vocabulary a user is trying to learn. It would be great if users can add their words via a speech to text program, instead of having to enter it manually. I am having trouble achieving this task. I am aware that there is an API for apple but not android. Is there anyway possible of doing this, using an API? Like for instance, google speech to text API? But I guess I would first have to be able to access the device's microphone. I am a beginner and this would be very easy using the web. Is React Native still too young for this task?

like image 345
Louis345 Avatar asked Oct 15 '16 15:10

Louis345


People also ask

How do I add text to speech in react?

Make sure your React app is running, and refresh the browser window of your app. Enter some text and press the SPEAK button. You should now hear a robotic voice that reads your text to you.


2 Answers

You might wanna look at react-native-android-voice, a React Native module that supports speech-to-text for Android.

As @delkant mentioned, there's now also react-native-voice that supports both Android and iOS.

Alternatively, you can always write your custom native module using Android's SpeechRecognizer API. Here's a summary of all the classes and interfaces you might need for this task. If you are familiar with developing native Android apps, it's pretty easy to create a native module and bind it to your React Native project. Here's the official documentation of how to achieve this.

like image 198
Georgios Avatar answered Oct 14 '22 05:10

Georgios


You also have react-native-voice

A speech-to-text library for React Native.

It supports android and iOS

like image 29
delkant Avatar answered Oct 14 '22 03:10

delkant