-1

Is it possible to activate the microphone input on a user's keyboard as an input to a textbox with a button using JavaScript? The keyboard microphone on iPhone and Android.

<input type="text"> <button onclick="activateMicrophone()">Activate Microphone</button>

enter image description here

Steve Alereza
  • 133
  • 1
  • 8

1 Answers1

0

Now when it comes to speech recognition with JavaScript, there used to be x-webkit-speech. Don't use that because it is depreciated for security reasons.

Instead, there is something called:

  • webkitSpeechRecognition [Google Chrome]
  • SpeechRecognition [Firefox]

Below is an example document of HTML code that utilizes the Speech Recognition API. The API may not work on all browsers. To the best of my knowledge, I can use it on Chrome and Firefox for now.

https://mdn.github.io/web-speech-api/speech-color-changer/