Speech Synthesis
Convert text to speech
BeginnerTopic: Browser API
JavaScript Speech Synthesis Program
This program helps you to learn the fundamental structure and syntax of JavaScript programming.
const utterance = new SpeechSynthesisUtterance('Hello World');
speechSynthesis.speak(utterance);Output
// Speaks "Hello World"
Understanding Speech Synthesis
Speech Synthesis converts text to speech.
Note: To write and run JavaScript programs, you need to set up the local environment on your computer. Refer to the complete article Setting up JavaScript Development Environment. If you do not want to set up the local environment on your computer, you can also use online IDE to write and run your JavaScript programs.