Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Voice Recognition in JavaScript

SAW
March 13, 2024

Voice Recognition in JavaScript

A presentation slide of Kyoto.js 21.

SAW

March 13, 2024
Tweet

More Decks by SAW

Other Decks in Programming

Transcript

  1. (FOFSBUJOHBSpeechRecognitionJOTUBODF (FUSpeechRecognitionQSPQFSUZGSPNwindowPCKFDU (FUUIFQSPQFSUZwebkitSpeechRecognitionPO4BGBSJBOE(PPHMF $ISPNF 5 // Get SpeechRecognition property. const

    speechRecognition = // Get SpeechRecognition or webkitSpeechRecogntion window.SpeechRecognition || window.webkitSpeechRecognition; const recognition = new speechRecognition();
  2. &YBNQMFPGstart()onresult()*NQMFNFOUBUJPO 7 // begin voice recognition recognition.start(); // get voice

    recognition result recognition.onresult((event) => { const { transcript } = event.results[0][0]; console.log(transcript); });