This is a great post! Can you show me how to use this in react js functional component. I don't really have an idea how to capture my text area's value inside a js variable.
Below is the onclick() function that I'm using to invoke record() function inside a button in reactjs.
Speech to text
const record = () => {
window.recognition.onresult = function(event) {
console.log(event);
let output = document.getElementById("output");
output.innerHTML = "";
for (let i = 0; i < event.results.length; i++) {
output.innerHTML = output.innerHTML + event.results[i][0].transcript;
}
}
window.recognition.start();
}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is a great post! Can you show me how to use this in react js functional component. I don't really have an idea how to capture my text area's value inside a js variable.
Below is the onclick() function that I'm using to invoke record() function inside a button in reactjs.
Speech to text
const record = () => {
window.recognition.onresult = function(event) {
console.log(event);
let output = document.getElementById("output");
output.innerHTML = "";
}
window.recognition.start();
}