Я пытаюсь сделать некоторые материалы для распознавания голоса на мобильном телефоне. Вот какой -то код .. < /p>
var recognition = new webkitSpeechRecognition();
recognition.onresult = function (e) {
//This is called every time the Speech Recognition hears you speak.
//You may say "How's it going today", the recognition will try to
//interpret what you're saying while you're speaking. For example, while
//you're speaking it may go.. "house" "how's it going" "how's it going today"
//as it interprets it returns an object that contains properties, one of
//which is "e.results.isFinal" where "i" is an array of returned objects.
//In this case the object with a transcript of "house" would have a
//"e.results.isFinal" value of false. Where as the object with a transcript
//of "how's it going today" would have a "e.results.isFinal" value of
//true.. Because this is the FINAL INTERPRETATION of this particular transcript.
//HOWEVER.. The problem I'm having is that when using a mobile device, the "e.results.isFinal" always
//has a value of true, even when it's not the final interpretation. It works correctly on desktop however. Both are using Chrome.
if(e.results[e.results.length-1].isFinal){
var finalTranscript = '';
for(i=0;i
Мне просто интересно, была ли у кого -то еще эту проблему, а также любую информацию о том, как обойти эту проблему.
У меня есть пример на мой веб -сайт.
https://jaymartmedia.com/example/speech.html
Я добавил немного отладки Информация на странице (чтобы я мог «увидеть» консоль, находясь на мобильном телефоне. На рабочем столе вы заметите «2: окончательный: false», а иногда и «2: окончательный: истинный». Это значение «e.Results . ISFINAL ". На мобильном он всегда будет (или, по крайней мере, каждый раз, когда я пробовал его на своем телефоне) быть" 2: final: true ". < /p>
Это вызывает мажор Проблемы, любое понимание будет высоко оценено>
Подробнее здесь: https://stackoverflow.com/questions/393 ... rect-value