Read Voice

 just voice

var msg = new SpeechSynthesisUtterance('Hello World');

window.speechSynthesis.speak(msg);


other demo :

https://webaudiodemos.appspot.com/AudioRecorder/index.html#

demo :

https://addpipe.com/simple-recorderjs-demo/


<!DOCTYPE html>

<html lang="en">


<head>

<meta charset="UTF-8">

<meta name="viewport" content=

"width=device-width, initial-scale=1.0">


<title>Speech to Text</title>

</head>


<body>

<div class="words" contenteditable>

<p id="p"></p>

</div>


<script>

var speech = true;

window.SpeechRecognition = window.SpeechRecognition

|| window.webkitSpeechRecognition;


const recognition = new SpeechRecognition();

recognition.interimResults = true;

const words = document.querySelector('.words');

words.appendChild(p);


recognition.addEventListener('result', e => {

const transcript = Array.from(e.results)

.map(result => result[0])

.map(result => result.transcript)

.join('')


document.getElementById("p").innerHTML = transcript;

console.log(transcript);

});

if (speech == true) {

recognition.start();

recognition.addEventListener('end', recognition.start);

}

</script>

</body>


</html>


Read Voice Read Voice Reviewed by Leo on April 12, 2022 Rating: 5

Tidak ada komentar

About me

About Me

My name is Joanne Doe, a lifestyle photographer and blogger currently living in Osaka, Japan. I write my thoughts and travel stories inside this blog.