Prompt
I'm building a browser app with text read-aloud, what API should I use?
Latest observation
Oct 11, 2026
OpenAI APIWeb search: off
For a browser app that reads text aloud, the usual choice is the Web Speech API, specifically:
speechSynthesisfor text-to-speechSpeechSynthesisUtteranceto create the spoken text
Simple example
const utterance = new SpeechSynthesisUtterance("Hello, world!");
speechSynthesis.speak(utterance);
Why use it
- Built into most modern browsers
- No backend required
- Easy to start with
Things to know
- Voice quality and availability vary by browser/OS
- Some browsers require a user interaction before audio can play
- You can choose voices if the browser exposes them
Example with a selected voice
const utterance = new SpeechSynthesisUtterance("This is a test.");
const voices = speechSynthesis.getVoices();
utterance.voice = voices.find(v => v.name.includes("Google")) || voices[0];
speechSynthesis.speak(utterance);
If you need more natural voices
If you want higher-quality, consistent voices across browsers, consider:
- Cloud TTS services like Google Cloud Text-to-Speech, Amazon Polly, or Azure Speech
- Then play the generated audio in the browser
Rule of thumb
- Quick/simple browser read-aloud: Web Speech API
- Best voice quality/control: Cloud Text-to-Speech + audio playback
If you want, I can show you a working React example or a vanilla JS read-aloud component.