EddyVerbruggen / nativescript-speech-recognition

:speech_balloon: Speech to text, using the awesome engines readily available on the device.
Other
90 stars 21 forks source link

stopListening request causes crashes when used in a worker #40

Open ghost opened 3 years ago

ghost commented 3 years ago

Hi, We are upgrading an app to N7 that uses the speech recognition plugin for transcribing what someone says. At the same time we record the audio of the speech using a different system. In order to do this successfully on the previous version on Nativescript we put the speech recognition functions in a worker.

Everything works fine until you try and stop the recognition. The app then immediately crashes. We have tracked down the crash to the line _this.recognitionRequest.endAudio(); in the stopListening method. If we remove this line, the app no longer crashes (but it also doesn't stop trying to do the recognition and therefore eventually hangs).

We have plugged it in to xCode and the error that seems to consistently come back is 'Cannot create a handle without a HandleScope'.

Do you know anything about this please? Can the recognizer no longer be used in a worker?

Thanks for the plugin, and any help you can provide!