TTS Prompt Patterns for Natural Speech
Sentence structure, punctuation, and pacing cues that improve TTS output.
TTS Prompt Patterns for Natural Speech is a free AI Prompt Engineering lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AI Prompt Engineering learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Why TTS Prompting Is Different
Text-to-Speech systems convert your text into audio literally. Unlike visual text where readers can re-read confusing parts, listeners experience audio linearly and cannot pause to decode an ambiguous sentence.
Writing for TTS means thinking about how words sound — rhythm, sentence length, pronunciation ambiguity, and the absence of visual formatting like bold or bullet points.
Sentence Length: Shorter Is Better
Long, complex sentences with multiple clauses are hard to follow in audio. TTS systems often break rhythm at grammatically correct but acoustically awkward points. Aim for sentences of 10-20 words for natural-sounding speech.
# Prompt a model to generate TTS-optimized text
TTS_SYSTEM_PROMPT = (
'You are writing text that will be read aloud by a text-to-speech system.\n\n'
'Rules:\n'
'- Use short, clear sentences (10-20 words each).\n'
'- Avoid complex nested clauses.\n'
'- End each sentence with a period for clear pause signals.\n'
'- Avoid parenthetical asides in the middle of sentences.\n'
'- Use conversational vocabulary — write as you would speak.\n'
'- Never use bullet points, headers, or markdown formatting.'
)
# Bad (long, nested):
BAD = (
'The transformer architecture, which was introduced in the landmark 2017 paper '
'"Attention is All You Need" by Vaswani et al. at Google, fundamentally changed '
'natural language processing by replacing recurrence with self-attention.'
)
# Good (TTS-friendly):
GOOD = (
'The transformer architecture changed natural language processing. '
'It was introduced in 2017 by researchers at Google. '
'Their key innovation was replacing recurrence with self-attention.'
)Punctuation as Audio Cues
TTS engines use punctuation to control pacing:
- Period (.): Full stop, longer pause
- Comma (,): Brief pause
- Question mark (?): Rising intonation
- Exclamation (!): Emphasis and energy
- Semicolon (;): Behavior varies by engine — often ignored
- Em dash (—): Often causes awkward pauses — avoid
Use explicit periods rather than em dashes or semicolons to control pacing reliably.
TTS_PUNCTUATION_PROMPT = (
'Write the following content for text-to-speech narration. '
'Use only periods, commas, and question marks for punctuation. '
'Avoid em dashes, semicolons, colons, and parentheses. '
'Break complex thoughts into multiple short sentences.\n\n'
'Content to rewrite: {content}'
)
# Example transformation
original = (
'There are three main factors to consider: cost, quality, and speed — '
'and often, you can only optimize for two of them (this is sometimes '
'called the project management triangle).'
)
for_tts = (
'There are three main factors to consider. The first is cost. '
'The second is quality. The third is speed. '
'Usually, you can only optimize for two of these at once. '
'This is sometimes called the project management triangle.'
)
print(for_tts)Avoiding Ambiguous Abbreviations
Abbreviations that readers decode visually become TTS mispronunciation traps. Different TTS engines handle abbreviations inconsistently.
Dr.→ might say 'Doctor' or 'Drive'St.→ 'Saint' or 'Street'?vs.→ 'versus' or 'vs'?etc.→ 'et cetera' or 'etcee'?
Spell out abbreviations in TTS text to ensure correct pronunciation.
TTS_ABBREVIATION_RULES = (
'When writing for text-to-speech:\n'
'- Write "Doctor" not "Dr."\n'
'- Write "Street" or "Saint" not "St."\n'
'- Write "versus" not "vs."\n'
'- Write "et cetera" not "etc."\n'
'- Write "for example" not "e.g."\n'
'- Write "that is" not "i.e."\n'
'- Write out years: "twenty twenty-five" not "2025" when narrated in prose\n'
'- Write out numbers under 10: "three" not "3" in conversational text\n'
'- Spell out acronyms on first use: '
'"Application Programming Interface, or API"\n'
)
print(TTS_ABBREVIATION_RULES)Words That Cause Mispronunciation
Certain words or patterns consistently trip up TTS engines. Know them and use alternatives:
- Homographs: 'read' (present vs past), 'lead' (metal vs guide), 'wind' — TTS picks one pronunciation
- Rare proper nouns: Technical terms, brand names, foreign words
- Numbers in unusual contexts: API versions, date formats, measurements
# Prompting LLM to detect and fix TTS pronunciation issues
TTS_REVIEW_PROMPT = (
'Review the following text for text-to-speech pronunciation issues.\n'
'Identify words that might be mispronounced by a TTS engine because they:\n'
'1. Are homographs with multiple pronunciations\n'
'2. Are technical terms, brand names, or foreign words\n'
'3. Are abbreviations or acronyms\n'
'4. Are numbers in unusual formats\n\n'
'For each issue, provide the original text and a TTS-safe replacement.\n\n'
'Text to review: {text}'
)
# Example issues and fixes
ISSUES = {
'She read the docs': 'She read (past tense - ambiguous) -> She finished reading the docs',
'Lead developer': 'Lead (metal or guide?) -> Lead (rhymes with feed) developer',
'API v2.3.1': 'v2.3.1 -> version 2 point 3 point 1',
'The .env file': 'dot E N V file (may say .env) -> the environment config file',
'Re-init': 'may say Ray-in-it -> reinitialize',
}
for problem, fix in ISSUES.items():
print(f'Issue: {problem}\nFix: {fix}\n')Numbers and Dates for TTS
Numbers are a major source of TTS awkwardness. Write them in a way that leaves no ambiguity about how they should be spoken.
NUMBER_TTS_RULES = (
'When writing numbers for TTS narration:\n'
'- Dates: write "January fifteenth, 2025" not "01/15/2025"\n'
'- Time: write "3 in the afternoon" not "15:00" in casual speech\n'
'- Percentages: write "forty-five percent" not "45%" in narration\n'
'- Large numbers: write "one point two million" not "1.2M"\n'
'- Phone numbers: spell with hyphens "555-123-4567" (TTS reads each digit)\n'
'- Currency: write "twelve dollars and fifty cents" not "$12.50" in speech\n'
'- Fractions: write "three quarters" not "3/4"\n'
'- Ordinals: write "first" not "1st" (TTS may say "one S T")\n'
)
# Apply when prompting the LLM to generate TTS scripts
TTS_SCRIPT_PROMPT = (
'Write a 30-second product announcement for text-to-speech.\n'
'Product: TaskFlow Pro, $49/month, 10,000 users worldwide, '
'launched January 2025.\n\n'
+ NUMBER_TTS_RULES
)Removing Visual Formatting
Markdown and HTML formatting is silent to the eye but spoken aloud by some TTS engines. Asterisks, pound signs, and angle brackets must be removed or replaced with spoken equivalents.
TTS_FORMAT_CONVERSION_PROMPT = (
'Convert the following markdown text into plain prose suitable '
'for text-to-speech narration.\n\n'
'Rules:\n'
'- Remove all markdown formatting (**, *, #, -, etc.)\n'
'- Convert bullet lists into spoken sequences '
'("First... Second... Third...")\n'
'- Convert headers into topic introduction sentences\n'
'- Remove any hyperlinks or URLs\n'
'- Convert code snippets into descriptions '
'("a Python function that...")\n\n'
'Markdown text:\n'
'{markdown_text}'
)
EXAMPLE_MARKDOWN = (
'## Getting Started\n'
'- Install the package with 'pip install mylib'\n'
'- Set your **API key** in '.env'\n'
'- Run 'python main.py' to start\n'
)
EXAMPLE_TTS = (
'To get started, install the package using pip. '
'Next, set your API key in your environment configuration file. '
'Finally, run the main Python script to start.'
)
print(EXAMPLE_TTS)Pacing with Transition Phrases
In written text, visual structure (paragraphs, headers) guides the reader. In TTS audio, you need verbal transition phrases to help listeners follow the structure.
TRANSITION_PHRASES = {
'starting_new_topic': ['Let us now talk about', 'Moving on to', 'Next,'],
'adding_information': ['Additionally,', 'Also worth noting,', 'Furthermore,'],
'contrasting': ['However,', 'On the other hand,', 'That said,'],
'concluding': ['To summarize,', 'In short,', 'To wrap up,'],
'sequencing': ['First,', 'Second,', 'Then,', 'Finally,'],
'emphasizing': ['Importantly,', 'Keep in mind that', 'Note that'],
}
TTS_STRUCTURE_PROMPT = (
'Write a two-minute explainer on {topic} for text-to-speech narration.\n'
'Use verbal transition phrases to guide listeners through each point. '
'Avoid headers or bullet points. '
'Structure the content with clear spoken signposts '
'("First...", "Moving on...", "To summarize...").'
)
print('Available transitions:')
for category, phrases in TRANSITION_PHRASES.items():
print(f' {category}: {phrases[0]}')Testing Your TTS Text
The only reliable test for TTS quality is to listen to it. Build a test-listen loop: generate text → send to TTS API → listen → iterate. Don't rely on reading the text visually.
import openai
import pathlib
client = openai.OpenAI(api_key='sk-...')
def generate_and_test_tts(text, output_file='test_audio.mp3'):
"""Generate TTS audio from text for auditory review."""
response = client.audio.speech.create(
model='tts-1-hd',
voice='alloy', # alloy, echo, fable, onyx, nova, shimmer
input=text,
speed=1.0 # 0.25 to 4.0
)
audio_path = pathlib.Path(output_file)
response.stream_to_file(audio_path)
print(f'Audio saved to {audio_path}')
print(f'Text length: {len(text)} chars, {len(text.split())} words')
return audio_path
# Generate and listen before shipping
tts_text = (
'Welcome to our weekly update. '
'This week, the engineering team shipped three major features. '
'First, we improved search speed by forty percent. '
'Second, we added support for twelve new languages. '
'Third, we launched our new mobile application.'
)
path = generate_and_test_tts(tts_text)Voice Selection and Prompt Matching
Different TTS voices have different strengths. Match the voice to your content tone:
- Warm/narrative: Storytelling, educational content
- Professional/neutral: Business reports, technical documentation
- Energetic/bright: Marketing, product demos, notifications
Prompt the LLM to write content that matches the voice's natural register.
VOICE_SPECIFIC_PROMPTS = {
'professional': (
'Write in a clear, neutral, professional tone. '
'Use complete sentences. Avoid contractions. '
'Suitable for business reports and documentation.'
),
'warm_narrative': (
'Write in a warm, engaging, conversational tone. '
'Use contractions naturally. '
'Speak directly to the listener using "you" and "we". '
'Suitable for educational content and storytelling.'
),
'energetic': (
'Write in an upbeat, enthusiastic tone. '
'Use shorter sentences for impact. '
'Include emphasis words like "amazing", "incredible", "now". '
'Suitable for marketing and product announcements.'
),
}
# Select based on use case
use_case = 'warm_narrative'
print(VOICE_SPECIFIC_PROMPTS[use_case])LLM-to-TTS Pipeline Design
In a production pipeline, an LLM generates text that is then passed to a TTS engine. The two must be coordinated: the LLM must know it is generating for TTS (not for reading), and any system prompt or post-processing must enforce TTS-friendly rules before the text reaches the TTS API.
Add a lightweight post-processing step between LLM output and TTS input: strip any markdown that leaked through, expand abbreviations, and check sentence length. This catches LLM formatting mistakes before they become audio artifacts.
Knowledge Check: TTS Sentence Structure
Which of the following texts is best formatted for text-to-speech narration?
Recap: TTS Prompt Patterns for Natural Speech
TTS text must be written for the ear, not the eye. Key rules: keep sentences to 10-20 words, use only periods and commas for pacing, spell out all abbreviations and numbers, remove all markdown and visual formatting, and use verbal transition phrases to replace visual structure. Words like homographs, technical terms, and unusual number formats cause mispronunciation — detect and replace them. Always test by listening to the generated audio, not by reading the text.
Frequently asked questions
Is the “TTS Prompt Patterns for Natural Speech” lesson free?
Yes — the full text of “TTS Prompt Patterns for Natural Speech” is free to read here on the web, and the AI Prompt Engineering course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AI Prompt Engineering course, upgrade to CoddyKit PRO.
What will I learn in “TTS Prompt Patterns for Natural Speech”?
Sentence structure, punctuation, and pacing cues that improve TTS output. You practise AI Prompt Engineering with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start AI Prompt Engineering?
No prior experience is required. AI Prompt Engineering on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “TTS Prompt Patterns for Natural Speech” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this AI Prompt Engineering lesson?
Yes. Every AI Prompt Engineering lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- TTS Prompt Patterns for Natural Speech
- SSML and Prosody Control
- Voice AI Persona Design
- Multimodal Voice and Text Agents