compulim / web-speech-cognitive-services

Polyfill Web Speech API with Cognitive Services Bing Speech for both speech-to-text and text-to-speech service.
https://compulim.github.io/web-speech-cognitive-services
MIT License
63 stars 18 forks source link

Request: code example for javascript browser azure speech recognition #112

Closed inglesuniversal closed 3 years ago

inglesuniversal commented 4 years ago

Your example code shows some code for node.js, do you have an example available for the browser (using the mic and a javascript library inside a script tag search element?)

The examples at azure github repository are way to long just to detect the voice.

thanks and stay safe.

compulim commented 3 years ago

This is a polyfill for W3C Web Speech API using Azure Cognitive Services. This library does NOT work in Node.js. It only works in browser.

You can find some Web Speech API samples from MDN. Instead of using window.SpeechRecognition, use the SpeechRecognition provided by this library, everything will work seamlessly.

https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API/Using_the_Web_Speech_API