Speech recognition and speech meteor in text on mobile phone

My goal here is to use the speech recognition feature for text using Meteor. I know that on most device keyboards there is already a microphone button that allows Speech to Text, but I want the user keyboard not to open.

To do this: I tried to use the used webKitSpeechRecognition here . It works for me on the desktop just fine. But when I go to my local host on my phone or actually create an application on my mobile phone (Android Galaxy s5), strange things begin.

When switching to localhost: Instead of having the final text, like on the desktop, I get every iteration of what my recognition object thought. For example: if I said: "Hello Stack". I get: "hellohellohello stackhello stack"

When starting the application for mobile devices: The microphone never turns on. None of my console.logs come in and nothing happens.

Here is the gist of all my code . And here are the relevant parts. Everything else is a pretty standard Meteor template.

recognition = new webkitSpeechRecognition(); recognition.continuous = true; recognition.interimResults = true; Session.set('final_span','') Session.set('interim_span','') final_transcript=''; recognition.onstart = function() { Session.set('listening',true) recognizing = true; console.log('started') } recognition.onresult = function(event) { var interim_transcript = ''; for (var i = event.resultIndex; i < event.results.length; ++i) { if (event.results[i].isFinal) { final_transcript += event.results[i][0].transcript; } else { interim_transcript += event.results[i][0].transcript; } } Session.set('final_span',final_transcript) Session.set('interim_span',interim_transcript); } 

I was looking for packages to solve this for me and did not find anything that worked.

TL; DR: any information on how to get voice recognition on a mobile device using Meteor.

+5
source share

All Articles