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

Speech Recognition on the Web (IM World 2016)

Speech Recognition on the Web (IM World 2016)

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.

Mihai Cîrlănaru

October 05, 2016
Tweet

More Decks by Mihai Cîrlănaru

Other Decks in Technology

Transcript

  1. 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(); }
  2. Speech Recognition Attributes // Sets the language to be recognized

    (32 languages // supported, incl. Romanian) 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; …
  3. 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 …
  4. Speech Recognition Result format { isFinal: true, resultIndex: 3, results:

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