Speech Recognizer in App inventor doesnt work to strings
I created a basic app (to practice).
So, i created one with this one:
Test App
So, when the button "habla" it's clicked the recognizer starts. After that i do a condition that compares the text obtained in the recognizer with the word "day". And if the word is same the player1 starts.
Now, i change the word "day" to "day tripper" and doesn't works. So how i can do to the recognizer detects string or more than 1 word?
button speech-recognition app-inventor
add a comment |
I created a basic app (to practice).
So, i created one with this one:
Test App
So, when the button "habla" it's clicked the recognizer starts. After that i do a condition that compares the text obtained in the recognizer with the word "day". And if the word is same the player1 starts.
Now, i change the word "day" to "day tripper" and doesn't works. So how i can do to the recognizer detects string or more than 1 word?
button speech-recognition app-inventor
you might want to display the recognized text in a label to find out, what's going on...
– Taifun
Dec 2 '18 at 16:31
add a comment |
I created a basic app (to practice).
So, i created one with this one:
Test App
So, when the button "habla" it's clicked the recognizer starts. After that i do a condition that compares the text obtained in the recognizer with the word "day". And if the word is same the player1 starts.
Now, i change the word "day" to "day tripper" and doesn't works. So how i can do to the recognizer detects string or more than 1 word?
button speech-recognition app-inventor
I created a basic app (to practice).
So, i created one with this one:
Test App
So, when the button "habla" it's clicked the recognizer starts. After that i do a condition that compares the text obtained in the recognizer with the word "day". And if the word is same the player1 starts.
Now, i change the word "day" to "day tripper" and doesn't works. So how i can do to the recognizer detects string or more than 1 word?
button speech-recognition app-inventor
button speech-recognition app-inventor
edited Jan 3 at 5:52
2Code
106
106
asked Nov 30 '18 at 21:17
paulpaul
1
1
you might want to display the recognized text in a label to find out, what's going on...
– Taifun
Dec 2 '18 at 16:31
add a comment |
you might want to display the recognized text in a label to find out, what's going on...
– Taifun
Dec 2 '18 at 16:31
you might want to display the recognized text in a label to find out, what's going on...
– Taifun
Dec 2 '18 at 16:31
you might want to display the recognized text in a label to find out, what's going on...
– Taifun
Dec 2 '18 at 16:31
add a comment |
1 Answer
1
active
oldest
votes
The number one skill involved in debugging is problem finding, and the problem you have stated for this is
I change the word "day" to "day tripper" and it doesn't work.
What you need to do, then, is change the logic flow from if mus.result = "day" to if mus.result includes "day".
One way to make this happen would be to initialize a new variable (name doesn't matter) as an empty list. Then, inside of the mus.AfterGettingText control block, set the variable to split at spaces mus.result. Split at spaces is a text function that creates a list of the words in a string.
Then, all you need to do is check each element in the list to see if it is the word "day". This way, the input can be any sentence with the word "day" and player1 would still start.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53565034%2fspeech-recognizer-in-app-inventor-doesnt-work-to-strings%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The number one skill involved in debugging is problem finding, and the problem you have stated for this is
I change the word "day" to "day tripper" and it doesn't work.
What you need to do, then, is change the logic flow from if mus.result = "day" to if mus.result includes "day".
One way to make this happen would be to initialize a new variable (name doesn't matter) as an empty list. Then, inside of the mus.AfterGettingText control block, set the variable to split at spaces mus.result. Split at spaces is a text function that creates a list of the words in a string.
Then, all you need to do is check each element in the list to see if it is the word "day". This way, the input can be any sentence with the word "day" and player1 would still start.
add a comment |
The number one skill involved in debugging is problem finding, and the problem you have stated for this is
I change the word "day" to "day tripper" and it doesn't work.
What you need to do, then, is change the logic flow from if mus.result = "day" to if mus.result includes "day".
One way to make this happen would be to initialize a new variable (name doesn't matter) as an empty list. Then, inside of the mus.AfterGettingText control block, set the variable to split at spaces mus.result. Split at spaces is a text function that creates a list of the words in a string.
Then, all you need to do is check each element in the list to see if it is the word "day". This way, the input can be any sentence with the word "day" and player1 would still start.
add a comment |
The number one skill involved in debugging is problem finding, and the problem you have stated for this is
I change the word "day" to "day tripper" and it doesn't work.
What you need to do, then, is change the logic flow from if mus.result = "day" to if mus.result includes "day".
One way to make this happen would be to initialize a new variable (name doesn't matter) as an empty list. Then, inside of the mus.AfterGettingText control block, set the variable to split at spaces mus.result. Split at spaces is a text function that creates a list of the words in a string.
Then, all you need to do is check each element in the list to see if it is the word "day". This way, the input can be any sentence with the word "day" and player1 would still start.
The number one skill involved in debugging is problem finding, and the problem you have stated for this is
I change the word "day" to "day tripper" and it doesn't work.
What you need to do, then, is change the logic flow from if mus.result = "day" to if mus.result includes "day".
One way to make this happen would be to initialize a new variable (name doesn't matter) as an empty list. Then, inside of the mus.AfterGettingText control block, set the variable to split at spaces mus.result. Split at spaces is a text function that creates a list of the words in a string.
Then, all you need to do is check each element in the list to see if it is the word "day". This way, the input can be any sentence with the word "day" and player1 would still start.
answered Jan 3 at 3:28
2Code2Code
106
106
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53565034%2fspeech-recognizer-in-app-inventor-doesnt-work-to-strings%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you might want to display the recognized text in a label to find out, what's going on...
– Taifun
Dec 2 '18 at 16:31