JoaoCnh / react-native-android-voice

react-native-android-voice is a speech-to-text library for React Native for the Android Platform.
MIT License
101 stars 33 forks source link

Not Working #20

Closed ashutosh-akss closed 7 years ago

ashutosh-akss commented 7 years ago

Thanks for writing this plugin , I am unable to install this , I am getting following error

TypeError: Cannot read property 'startSpeech' of undefined(…)
JoaoCnh commented 7 years ago

Are you having problem installing or using it?

TBousard commented 7 years ago

same issue here I get "uresolved function or method startSpeech()"

niftytushar commented 7 years ago

@JoaoCnh When I import the lib in my component and log it, it is undefined.


import SpeechAndroid from 'react-native-android-voice';
console.log(SpeechAndroid);
// SpeechAndroid is undefined
`

I've done the setup properly following the instructions provided in README. Any clue why this would be happening?
JoaoCnh commented 7 years ago

It really shouldn't be happening. What is your version of RN?

I might need to patch this for newer versions

niftytushar commented 7 years ago

My RN version is 0.40.0

I've patched the library for latest RN and created a PR, you can review and merge it. It is working well for me now.

hszeto commented 7 years ago

I have the same problem.

import SpeechAndroid from 'react-native-android-voice';
console.log(SpeechAndroid);
// SpeechAndroid is undefined

any idea why?

niftytushar commented 7 years ago

@hszeto you can use my fork to setup for now. https://github.com/niftytushar/react-native-android-voice

npm install --save niftytushar/react-native-android-voice

It has updated instructions to install, so you might need to check that too.

hszeto commented 7 years ago

Thank you niftytushar !

niftytushar commented 7 years ago

@hszeto Don't remove async and await!

It won't work on emulator, it must be having a older version of Android API.

Try it on an android device, it works perfectly.

On Fri, Jan 27, 2017 at 2:41 PM, Henry Szeto notifications@github.com wrote:

SpeechAndroid is no longer undefined now. However, I follow this example https://github.com/JoaoCnh/react-native-android-voice/wiki/v0.1.1

Clicking on "Speak" , nothing happens.

Removing async and await. Console.log(spokenText) and I get this: Promise {_45: 0, _81: 0, _65: null, _54: null}

Is there a better example showing how to use this library? I'm running react-native 0.39 with Android emulator.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/JoaoCnh/react-native-android-voice/issues/20#issuecomment-275620156, or mute the thread https://github.com/notifications/unsubscribe-auth/AEir7jvoEimP7rtLGwm14HSqsWCmta0Fks5rWbTTgaJpZM4LFvYx .

-- Regards

Tushar Agarwal