artyom.js
artyom.js copied to clipboard
Verify the microphone issue
Hello there,
I am using Google Chrome Version 69.0.3497.100 (Official Build) (64-bit).
Operating System: Windows 10 Pro
I am getting very serious issue suddenly:
Verify the microphone and check for the table of errors in sdkcarlos.github.io/sites/artyom.html to solve your problem. If you want to give your user a message when an error appears add an artyom listener
Machine voice is working, but my voice command is accepted due to the above issue.
Can you please help me.
hy,
i had the same problem especially in loud environments or when guests are over and there is a lot of gibberish for the system and i think i found a solution - at least it does not happen anymore:
pure speculation but i think this problem shows up when there is continous mode on and the command-recognition takes longer than the new cycle starts to keep up continous.... so when there is a lot of gibberish (could also be a bad microphone that rumbles or has indifferences if wireless) artyom does not know when the command is done - keeps the mic up because of all the background noise and somehow crashes after some time... if it is not that make sure you have no other instance of artyom in other chrome-tabs or windows open.
anyway i solved it by adding an eventlistener here:
var command_listening_sound = new Audio('SOME_AT_LEAST_3_SECONDS_LONG_HUMMING_SOUND.mp3');
artyom.redirectRecognizedTextOutput(function(text,isFinal){
var span = document.getElementById('output');
if(isFinal){
span.innerHTML = text;
window.command_listening_sound.pause();
} else {
span.innerHTML = text;
window.command_listening_sound.currentTime=0;
window.command_listening_sound.play();
window.command_listening_sound.addEventListener('timeupdate', timeupdateREAL);
};
});
function timeupdateREAL(){
if (window.command_listening_sound.currentTime > 3) {
abortartyom();
}};
function abortartyom(){
console.log("Timeoutreached");
window.command_listening_sound.removeEventListener('timeupdate', timeupdateREAL);
artyom.ArtyomWebkitSpeechRecognition.abort();
};
i let the eventlistener refer to a soundfile so i have audio-feedback if commandrecognition stopped. it works most elegant if it is a sound that fades in a mild humming-sound - so it just fades in after the last recognised actual word.
hey this is my first post here and i hope i was of help - english is not my first language :-)