-
-
Save RafidSadat404/0b3d210c2ad5afb6831c98a1448bf203 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Code for tutorial: https://www.youtube.com/watch?v=4eIRrowvLRk --> | |
<!-- DevHoot Publication --> | |
<!-- Website: https://devhoot.ooo --> | |
<!-- Note: This code was produced by Imran Khan @DevHoot --> | |
<!-- If you find this useful consider subscribing to our YouTube channel and website --> | |
<!-- patreon Support: https://www.patreon.com/devhoot --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> | |
<body> | |
<!-- Input area --> | |
<label for="Speech Recognition">Speech Recognition</label> | |
<input type="text" name="" id="speechToText" placeholder="Speak Something" onclick="record()"> | |
<!-- Below is the script for voice recognition and conversion to text--> | |
<script> | |
function record() { | |
var recognition = new webkitSpeechRecognition(); | |
recognition.lang = "en-GB"; | |
recognition.onresult = function(event) { | |
// console.log(event); | |
document.getElementById('speechToText').value = event.results[0][0].transcript; | |
} | |
recognition.start(); | |
} | |
</script> | |
<!-- end of script --> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment