Voice and media
What is text-to-speech (TTS)?
Text-to-speech (TTS) turns written text into spoken audio. Learn how TTS works, how neural voices differ from older methods, and where it's used.
Text-to-speech (TTS) is technology that converts written text into spoken audio. You give it a sentence, and it returns a synthetic voice reading that sentence aloud. Modern TTS uses neural networks and can sound close to a human speaker, though quality still varies with the voice, the language, and the text.
How does text-to-speech work?
Most TTS systems do two jobs: work out what to say, then generate the sound of saying it. The classic pipeline has these stages:
- Text normalization. Numbers, dates, abbreviations and symbols are expanded into words. "Dr. Rao paid $5 on 3/4" has to become something speakable, and the right reading depends on context.
- Pronunciation. Each word is converted into phonemes, the basic sound units of a language. Dictionaries handle common words, and a model guesses for names and unusual words.
- Prosody. The system decides rhythm, stress, pitch and pauses. This is what separates natural speech from a flat monotone.
- Waveform generation. A vocoder or similar component turns the planned sounds into an actual audio signal you can play.
Newer end-to-end models blur these stages together. They take text in and produce audio out, learning pronunciation and prosody from large amounts of recorded speech rather than from hand-written rules. The general field is called speech synthesis.
Types of text-to-speech
| Type | How it works | Typical sound |
|---|---|---|
| Concatenative | Stitches together small recorded snippets of a human voice | Clear but choppy at the joins |
| Parametric | Generates speech from statistical models of sound | Smooth but often robotic |
| Neural | Deep learning models generate the audio directly | Natural rhythm and intonation |
Neural TTS is what most current products use, because it handles stress and pacing far better than the older approaches.
What is TTS used for?
- Accessibility. Screen readers and reading tools help people who are blind, have low vision, or have dyslexia consume written content.
- Assistants and navigation. Spoken directions, alerts and replies all rely on TTS.
- Content. Articles read aloud, audiobooks, and video narration.
- Chat communities. In a voice channel, TTS lets someone who can't or won't speak join the conversation by typing.
TTS vs speech-to-text vs voice AI
These terms get mixed up. TTS goes from text to audio. Speech-to-text (also called speech recognition or STT) goes the other way, from audio to text. A voice assistant usually combines both with a language model in the middle. Some newer systems skip the text step and work on audio directly; see how voice AI assistants work for the details.
What makes a TTS voice sound good?
Naturalness depends on a few things you can actually judge by listening: correct pronunciation of names and numbers, sensible pauses at commas and sentence ends, and stress on the right words. Short, clean sentences also help. Long run-on text, emoji, and unusual formatting are the usual causes of strange output.
Common mistakes with TTS
- Feeding it raw formatting. Markdown symbols, URLs and emoji get read out loud or skipped awkwardly. Strip or simplify them first.
- Ignoring the language setting. A voice tuned for one language pronounces another language badly.
- Expecting instant long reads. Very long passages are often split into chunks and played in sequence.
- Assuming consent isn't needed. In a shared voice channel, reading text aloud affects everyone present, so use it considerately.
Doing this with Based
Based can read text aloud in a voice channel. Use /tts with some text to have it spoken once, or run /tts with no text to opt in to having your later messages in that channel read aloud. /say sends typed text into an active voice conversation instead. Every slash command also works with the "." prefix, for example .tts. The voice and language are set in the voice module; see the voice docs and the voice chat feature page.
Frequently asked questions
What does TTS stand for?
TTS stands for text-to-speech. It means software that reads written text out loud using a synthetic voice.
Is text-to-speech the same as speech recognition?
No. Text-to-speech turns text into audio, while speech recognition (speech-to-text) turns audio into text. Voice assistants often use both.
Why do some TTS voices sound robotic?
Older concatenative and parametric methods struggle with natural rhythm and stress. Neural TTS handles prosody much better, though odd formatting or a mismatched language can still make any voice sound off.
Can a Discord bot read messages aloud?
Yes, if it joins a voice channel and has a TTS feature. Based can read supplied text with /tts or read your later messages in a channel after you opt in.
Keep learning
- Voice and media
How do voice AI assistants work?
How voice AI assistants work: speech recognition, a language model and text-to-speech, versus newer speech-to-speech models, and why latency matters.
- AI basics
What is generative AI?
Generative AI creates new content such as text, images, audio and code from a prompt. Learn how it works, what it can make and where it falls short.
- Voice and media
What are temporary voice channels on Discord?
Temporary voice channels are Discord rooms created on demand and deleted when empty. Learn how join-to-create works and how to set it up.
- Voice and media
How do music bots work on Discord?
How Discord music bots work: joining voice, streaming audio from sources, managing queues, and why many bots avoid YouTube. Includes common fixes.
Try it in your server
Based is an AI Discord bot in 300+ servers. Every slash command also works with the "." prefix.