Search code examples
webspeech-api

How to list and allow selection of input devices to be used for WebSpeech API?


Is there a way to programmatically list available input devices and allow to change the current one being used for the WebSpeech API?

I'm aware Chrome shows a video icon on the address bar where a device can be chosen, but I want to make this setting available on the web app itself.


Solution

  • Yes, there's a way- take a look at https://webaudiodemos.appspot.com/input/index.html, it lets the user select the input. PS: This works just for chrome.

    Also you can look this example using webrtc, however I'm not sure if it can be integrated with webspeechapi: https://webrtc.github.io/samples/src/content/devices/input-output/

    Also, take a look at this post: https://developers.google.com/web/updates/2015/10/media-devices It has a lot of information