Ended up changing it to the following just to get it working for now locally:
if (!transcripts.isEmpty()) {
let x;
for (var i = 0; i < transcripts.size(); i++) {
var transcript = transcripts.get(i);
x = transcripts.get(0);
}
options.onResult({
text: x,
finished: true
});
}
Working on a video with the plugin and ran on Android and kept getting undefined in the
onResult
callback in thestartListening()
method withtranscript.text === undefined
https://github.com/EddyVerbruggen/nativescript-speech-recognition/blob/master/speech-recognition.android.ts#L117Running on Android 6.0.
Ended up changing it to the following just to get it working for now locally: