voice icon indicating copy to clipboard operation
voice copied to clipboard

Offline Recognition

Open blackcoudpm opened this issue 6 years ago • 8 comments
trafficstars

How do I enable to use offline speech recognition?

thankful

blackcoudpm avatar Aug 06 '19 18:08 blackcoudpm

You have to edit VoiceModule.java (inside the library) inside startListening() method, above speech.startListening(intent); adding this line: intent.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE,true);

Phasor1 avatar Sep 27 '19 07:09 Phasor1

Does anyone have a nice fork where all the extra android configuration can be applied?

erksch avatar Oct 11 '19 15:10 erksch

@blackcoudpm Did you solved your problem?

lfoliveir4 avatar Dec 16 '19 12:12 lfoliveir4

@erksch On Android you need to install Google, Assistant and Voice search. In Assistant settings you can setup offline speech recognition and download many languages! There is no need to add an intent.

hwadii avatar Jan 11 '20 23:01 hwadii

I added the offline (and others) extra to the modules java code, but would be nice if all extras could be passed from the outside

akrueger90 avatar Jun 17 '20 11:06 akrueger90

As shown: https://developer.apple.com/documentation/speech/sfspeechrecognitionrequest/3152603-requiresondevicerecognition?language=objc

It is possible to use offline speech recognition, now, in ios but I don't know how to configure the module to use offline recognition.

How do I use offline speech recognition on IOS? Thanks.

danoo1 avatar Jul 06 '20 13:07 danoo1

Can anyone help here? Unable to get this to work for anything other than english language

nikhilbhawsinka avatar Nov 13 '20 09:11 nikhilbhawsinka

Tienes que editar VoiceModule.java (dentro de la biblioteca) dentro del método startListening (), arriba speech.startListening(intent); agregando esta línea: intent.putExtra(RecognizerIntent.EXTRA_PREFER_OFFLINE,true);

I used it like this, it is in the file node_modules/react-native-voice/src/main/java/com/wenkesj/voice/VoiceModule.java but apparently you also need to add or download languages offline in your smartphone settings

vsalguero avatar Aug 27 '21 05:08 vsalguero