Reputation: 11
I tried the SpeechRecognitionAPI on Safari with iPhone7 and iPhoneSE gen3. "isFinal" property of SpeechRecognitionResult is always "false".
I have tried it on multiple devices, but it does not seem to depend on the iOS version. Some devices do not occur this issue, even with the same iOS version.
Does anyone have any solutions to solve this issue?
SpeechRecognition = webkitSpeechRecognition || SpeechRecognition;
let recognition = new SpeechRecognition();
recognition.lang = 'ja-JP';
recognition.interimResults = true;
recognition.continuous = true;
recognition.onresult = (event) => {
for (let i = event.resultIndex; i < event.results.length; i++) {
let transcript = event.results[i][0].transcript;
if (event.results[i].isFinal) {
// never enter this block
console.log('final#' + transcript );
} else {
console.log('interim#' + transcript );
}
}
}
Upvotes: 1
Views: 126