- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear friends,
My name is Alex Hang, i am 16 years old, and i'm from Bucharest, Romania. I am trying to build an Android app using Intel XDK for an international programming contest. Intel XDK really helps me and makes everything easier, but i have one single problem: i want to introduce a speech to text feature in the app, but everithing I tried doesn't works. Can you help me ?
Alex
- Tags:
- HTML5
- Intel® XDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello. I am using the plugin org.apache.cordova.speech.speechrecognition from Cordova Repository. It is working good. Android is easier. iOS you need an account (see in documentation).
You can see this plugin working in "Fale para Bate-Papo" (Speak to Chat), Android and iOS.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello. I am using the plugin org.apache.cordova.speech.speechrecognition from Cordova Repository. It is working good. Android is easier. iOS you need an account (see in documentation).
You can see this plugin working in "Fale para Bate-Papo" (Speak to Chat), Android and iOS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you Sir, your help was precious for me. I tried it and it worked properly.
Alex Hang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Alex,
Thanks Hamilton Tenório da Silva!
Here is the iOS detailed documentation.
https://software.intel.com/en-us/xdk/docs/building-cordova-ios-apps-intel-xdk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help. Both examples are very useful and helped me a lot.
I used mister Hamilton Tenorio da Silva's example and I found this code sample:
<script type="text/javascript"> var recognition; document.addEventListener('deviceready', onDeviceReady, false); function onDeviceReady() { recognition = new SpeechRecognition(); recognition.onresult = function(event) { if (event.results.length > 0) { q.value = event.results[0][0].transcript; q.form.submit(); } } } </script> <form> <input type="search" id="q" name="q" size=60> <input type="button" value="Click to Speak" onclick="recognition.start()"> </form>
It works really well but i need to memorize the word ( words) that I say in a variable so that I can use it later in the app.
I also found on the internet another very good Speech Recognition code sample, but I have the same problem: it doesn't memorize the word (words) in a variable.This one requires this plugin: https://github.com/poiuytrez/SpeechRecognizer.git
<script type="text/javascript"> function onDeviceReady(){ console.log("Device is ready"); } function recognizeSpeech() { var maxMatches = 5; var promptString = "Speak now"; // optional var language = "en-US"; // optional window.plugins.speechrecognizer.startRecognize(function(result){ alert(result); }, function(errorMessage){ console.log("Error message: " + errorMessage); }, maxMatches, promptString, language); } // Show the list of the supported languages function getSupportedLanguages() { window.plugins.speechrecognizer.getSupportedLanguages(function(languages){ // display the json array alert(languages); }, function(error){ alert("Could not retrieve the supported languages : " + error); }); } document.addEventListener("deviceready", onDeviceReady, true); </script> <button onclick="recognizeSpeech();">Start recognition</button> <button onclick="getSupportedLanguages();">Get Supported Languages</button>
Can somebody help me to memorize the word( words) that I say in a variable? If somebody knows another code sample, it will be very helpful.
Alex Hang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Alex> I dind´t know if I undertand your question. Do you need to save the words in a variable to use in another moment?
You can save when you get the return (q.value = event.results[0][0].transcript;). The string can be used normally. Just save in a database or cookie.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much Sir, I would not have been able to finish this application without your help. The Speech to Text Method is working excellent.
Alex Hang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Alex: great! Googd luck with the app.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have only one single problem.
I am also trying to introduce a text to speech feature in the app. It has the purpose to read the texts in the app. I tried to use this plugin https://github.com/domaemon/org.apache.cordova.plugin.tts But when I try to make it "talk" using the below code sample ( I found it on the Internet), nothing happens. Can anyone help me with a different plugin and code sample or indicate me a code sample that works with this plugin ?
window.plugins.tts.speak("Welcome to Discover Romania", win, fail);
Alex Hang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Alex> I am using this same plugin. It works well in Android (iOS is not working, but I have no time to find the problem...).
As far as I remember, just change the code to "navigator.tts.speak("xxxx", ...".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi can anyone help me, how do i include the cordova speech recognition plugin into intel xdk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Sir!
After you created a project, in order to introduce a plugin to your app you have to open the Projects tab. To do it you must click on the "Projects'' Button in the upper left corner of the screen. When the page is opened, click on the "+" near the text "Plugin Management". Then click on "Add Plugin to this project". On the left side of the window you will have a list. Select "Third Party Plugins". On the screen you will see in the upper part of the window a line where it says: "Plugin Source". Select the second option ("Git Repo"). Now in the Repo URL field you have to write this link https://github.com/macdonst/SpeechRecognitionPlugin.git
Now, Intel XDK will add the plugin to the project, and will show a succes message when everything is done.
This is how i did and it worked well. I hope this post will be useful.
Alex Hang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the plugin work fine thanks for the help but i encounter a problem regard with the example given for the speech recognition.
How do i apply it on intel xdk, like how i apply the example in intel xdk because everytime i try to test it on app preview it cam out nothing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try to build your app and test it directly on your device, by installing the apk file. I had the same problem, the speech recognition was not working on app preview, but when I built the app and installed it on my Android Device it worked perfectly.Just use the example given above. only the first example works with this plugin. The second example requires this plugin http://https://github.com/poiuytrez/SpeechRecognizer.git
i tried them both and they work excellent !
I hope this comment was useful !
Alex Hang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
okay im using plugin https://github.com/poiuytrez/SpeechRecognizer and do i need to include
SpeechRecognizer.startRecognize(success, error, maxMatches, promptString, language);
SpeechRecognizer.getSupportedLanguages(success, error);
or just use the full example code only
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I only used the code sample from that post.
I tried it and it works excellent !
Just use this code and it will surely work.
<script type="text/javascript"> function onDeviceReady(){ console.log("Device is ready"); } function recognizeSpeech() { var maxMatches = 5; var promptString = "Speak now"; // optional var language = "en-US"; // optional window.plugins.speechrecognizer.startRecognize(function(result){ alert(result); }, function(errorMessage){ console.log("Error message: " + errorMessage); }, maxMatches, promptString, language); } // Show the list of the supported languages function getSupportedLanguages() { window.plugins.speechrecognizer.getSupportedLanguages(function(languages){ // display the json array alert(languages); }, function(error){ alert("Could not retrieve the supported languages : " + error); }); } document.addEventListener("deviceready", onDeviceReady, true); </script> <button onclick="recognizeSpeech();">Start recognition</button> <button onclick="getSupportedLanguages();">Get Supported Languages</button>
Alex Hang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ops sorry i forgot to enable a voice speech input in my device no wonder it doesn't work.
Okay how do i make the voice speech input variable on a text box rather using an alert box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hafiz Y, if you want to have the speech transcription in a text box, you can use the first example without changing anything.
<script type="text/javascript"> var recognition; document.addEventListener('deviceready', onDeviceReady, false); function onDeviceReady() { recognition = new SpeechRecognition(); recognition.onresult = function(event) { if (event.results.length > 0) { q.value = event.results[0][0].transcript; q.form.submit(); } } } </script> <form> <input type="search" id="q" name="q" size=60> <input type="button" value="Click to Speak" onclick="recognition.start()"> </form>
This is the code line that shows the transcript in the text box.
<input type="search" id="q" name="q" size=60>
You can adapt this code line for the second example if you want. Instead of "q", at the second example the variable that contains the transcript is "result". If you want the app not to show ant other alerts delete this code line from the second example.
alert(result);
I hope this post was useful !
Alex Hang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex H.
I'm using the plugin from http://https://github.com/poiuytrez/SpeechRecognizer.git and I facing some problem which are TypeError: Cannot read property 'startRecognize' of undefined. Do you have this kind of problem?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex,
I currently develop using mobileFirst, the plugin is run on Ionic application, how can i run the PhoneGap build?
Thanks.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page