Danny Fox
Danny Fox

Reputation: 40799

How to access to the microphone in JS?

The webcam is supported already in Opera Next, but what about microphone support? Do you know something about it?

Upvotes: 11

Views: 9011

Answers (2)

Enlil
Enlil

Reputation: 1

navigator.mediaDevices?.getUserMedia({audio : true}).then((audioStream) => { do what you need})

Upvotes: -1

Allan Kimmer Jensen
Allan Kimmer Jensen

Reputation: 4389

I know that there is a spec located here: http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html

And that webkit supports it like this: http://www.labnol.org/software/add-speech-recognition-to-website/19989/

The correct code would be:

<input x-webkit-speech type="text" />

Upvotes: 5

Related Questions