Speech Recognition on the Web (JSConf Iceland)

Speech Recognition on the Web (JSConf Iceland)

We've all been impressed by the likes of Siri, Google Now, and Cortana, for understanding our spoken words, but is it possible to take advantage of the powerful speech recognition behind such services on the web? This talk will explore the Web Speech API and how it can empower web apps for improved accessibility and new ways of user interaction.

2f55ef3093479f2bb68b7ec5e1ead838?s=128

Mihai Cîrlănaru

August 25, 2016
Tweet

Transcript

  1. Speech Recognition on the Web Mihai Cîrlănaru

  2. Mihai Cîrlănaru

  3. None
  4. None
  5. None
  6. None
  7. None
  8. None
  9. None
  10. None
  11. None
  12. DEMO

  13. Web Speech API Spec

  14. Web Speech API const SpeechRecognition = SpeechRecognition || webkitSpeechRecognition; let

    recognizer = null; if (!SpeechRecognition) { console.error("Web Speech APIs not supported in your browser"); } else { recognizer = new SpeechRecognition(); }
  15. Speech Recognition Attributes // Sets the language to be recognized

    (32 languages // supported, incl. Icelandic) recognizer.lang = 'en-US'; // Get recognition results as early as possible, // even if they will change recognizer.interimResults = true; // Continuously listen to speech, regardless if // the user takes pauses or not recognizer.continuous = true; // The number of alternative recognition // matches to be returned recognizer.maxAlternatives = 3; …
  16. Speech Recognition Event Handlers recognizer.onresult // Whenever a speech recognition

    match is found recognizer.onnomatch // When no match was found for the current speech recognizer.onerror // When an error occurred …
  17. Speech Recognition Control recognizer.start(); recognizer.stop();

  18. Speech Recognition Result format { isFinal: true, resultIndex: 3, results:

    [ [ { transcript: "hello" } ], [ { transcript: "world"}, { transcript: "word"}, … ], … ] … }
  19. DEMO

  20. Browser Support

  21. Thank You Mihai Cîrlănaru