- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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 kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Thank you Sir, your help was precious for me. I tried it and it worked properly.
Alex Hang
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
@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.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
@Alex: great! Googd luck with the app.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
@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", ...".
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
hi can anyone help me, how do i include the cordova speech recognition plugin into intel xdk
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
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.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi Alex,
I currently develop using mobileFirst, the plugin is run on Ionic application, how can i run the PhoneGap build?
Thanks.
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite