Web Speech API: Speech Recognition (Cont’d)
recognition.lang = ‘en-US’; recognition.interimResults = false;
Some properties
recognition.start();
Methods: start(), stop(), abort()
recognition.addEventListener(‘result’, (e) => { let last = e.results.length - 1; let text = e.results[last][0].transcript; }); @
Events: onresult, onerror, onaudiostarted, onaudioend, etc.