Workflow · Audio
Build an AI Podcast Generator
Turn any article, paper, or transcript into a multi-voice podcast episode with natural-sounding hosts.
Problem
Writing podcasts is hard. Recording them is harder. You have great written content — articles, papers, blog posts — and you want them in audio form without spending 4 hours per episode.
Final output
A 6–10 minute MP3 of two distinct AI hosts having an actual conversation about your source material. Includes show notes, timestamps, and a title. Ready to upload to any podcast host.
Architecture
URL or text input
→ Content extraction (Readability/Mozilla)
→ LLM dialogue generation (Claude/GPT)
→ ElevenLabs voice synthesis (per speaker, per line)
→ ffmpeg stitching with light bed music
→ Output: MP3 + show notes + thumbnail promptsStep-by-step
- 01
Extract source content
Use Readability (Node or Python) to strip nav/ads from a URL. For PDFs, use pdfplumber or Anthropic's PDF input. Cap at ~12K tokens.
- 02
Generate two-host dialogue
Prompt a strong LLM to convert your text into ~120 lines of JSON ({speaker, line}). Define two distinct hosts. Cap line length 15-25 words.
- 03
Synthesize audio per line
Loop through dialogue, call ElevenLabs with the matching voice. Run ~5 in parallel. Save as 001_A.mp3, 002_B.mp3, ...
- 04
Stitch with ffmpeg
Concatenate clips with 100ms silences between turns. Layer light bed music at -22 LUFS.
- 05
Generate show notes
Ask the LLM for: title, 2-line summary, 5 takeaways, inferred timestamps. Save as Markdown alongside the MP3.
What you'll build
A pipeline that takes a URL or text input and produces a finished MP3 of two hosts discussing the content for 6–10 minutes.
High-level flow
- Extract source content — fetch URL, strip boilerplate, get clean text.
- Generate script — LLM rewrites the content as a two-host dialogue.
- Synthesize audio per speaker — ElevenLabs generates each line in the right voice.
- Stitch — ffmpeg concatenates with light crossfades + background music.
- Publish — upload to your host, generate show notes from the script.
Step 1 — Extract
Use a clean-content extractor like Mozilla Readability, @mozilla/readability in Node, or readability-lxml in Python. For PDFs, use pdfplumber or Anthropic's PDF input.
Keep the extracted text under ~12K tokens — long inputs make the script meander.
Step 2 — Script generation
Use a strong model (Claude or GPT-5). Key prompt elements:
- Define two host personas with distinct voices and roles (e.g. curious host + expert).
- Require structured output:
[{ speaker: "A" | "B", line: string }]. - Cap line length (15–25 words) for natural pacing.
- Instruct: no filler intros, no "welcome to the show" — get to substance.
- Inject ~3 anchor points: opening hook, key transition, closing wrap.
Step 3 — Audio synthesis
For each line, call ElevenLabs with the matching voice. Use Eleven Multilingual v2 for highest quality.
Important details:
- Run requests concurrently but cap at ~5 parallel — rate limits are real.
- Save each clip to a temp folder as
001_A.mp3,002_B.mp3, ... - Re-run any clip that comes back glitchy (rare, but happens).
Step 4 — Stitch
ffmpeg -f concat -safe 0 -i clips.txt -c copy episode.mp3
Add a 100ms silence between speaker turns. Bed in light music at -22 LUFS under the dialogue.
Step 5 — Publish
Generate show notes by asking the LLM for: title, 2-line summary, 5 bullet takeaways, timestamps inferred from line counts.
Upload the MP3 + notes to your host (Transistor, Buzzsprout, or Spotify for Podcasters).
Polish ideas
- Detect tone (technical / casual / debate) and adjust voice settings per segment.
- Add a "cold open" line generated separately.
- Train a Professional Voice Clone for a recurring host.
Prompt examples
Copy any of these, replace the placeholders, run.
Dialogue generation prompt
Convert the following source material into a 7-minute two-host podcast dialogue.
Host A: curious generalist who asks clarifying questions.
Host B: domain expert who explains and pushes back.
Rules:
- Output JSON: an array of { speaker, line }. ~120 lines total.
- Each line is 15–25 words; conversational; one idea per line.
- No "welcome to the show" intros. Start in the middle of the conversation.
- 3 anchor points: opening hook, key transition, closing wrap.
- Host A and B should occasionally disagree or push back.
Source:
"""
{{cleaned_text}}
"""Show notes prompt
Given this podcast script, produce show notes:
{
"title": "Punchy, specific. Under 60 chars.",
"summary": "2-line description for the podcast feed.",
"takeaways": ["5 bullets, one sentence each, no fluff."],
"timestamps": [
{ "time": "0:00", "topic": "..." },
...
]
}
Script:
"""
{{script}}
"""Cost estimate
| Line item | Approx. cost |
|---|---|
| Content extraction | $0.00 |
| LLM script generation (Claude Sonnet) | $0.05 |
| ElevenLabs synthesis (10-min, Creator tier) | $1.50 |
| Stitching + bed music | $0.00 |
| Show notes generation | $0.02 |
| Total per run (approx.) | ~$1.57 |
Costs depend on model choice, content length, and how aggressively you cache.
Optimizations
- Cache extracted content — same URL produces the same input, so re-runs cost nothing on extraction.
- Use prompt caching for the dialogue prompt template (huge savings if you batch many sources).
- For high-volume work, switch to ElevenLabs Turbo (lower per-character cost, slightly lower quality).
- Run synthesis in parallel — 5 concurrent requests typically stays under rate limits.
- Pre-generate a library of bed music tracks; randomize per episode for variety.
Common mistakes
- Letting the LLM write 'intros' like 'Welcome to the show!' — strip these in the prompt or post-process.
- Running ElevenLabs sequentially — 5x slower for no reason.
- Forgetting to normalize audio levels — clips can have inconsistent volume, jarring on playback.
- Skipping the bed music — pure TTS sounds artificial; a quiet bed at -22 LUFS adds polish.
- Generating dialogue that's too long for the source — set a target word count tied to your audio duration target.
Frequently asked questions
Related on AIKnowHub
Tool Guide
ElevenLabs Guide
The best-in-class text-to-speech and voice cloning platform. Used for podcasts, audiobooks, dubbing, and game characters.
Directory
ElevenLabs
Best-in-class text-to-speech, voice cloning, and conversational voice agents.
Concept
Prompt Engineering Basics
The actual techniques that move the needle — role priming, structured output, few-shot examples, and why specificity always wins.
Workflow
Build an AI YouTube Shorts Generator
An end-to-end pipeline that turns a single topic prompt into a finished 30-second vertical video with voiceover, captions, and B-roll.
Learning Path
AI Creator Roadmap
For writers, YouTubers, podcasters, and indie creators. Use AI to do more, better, faster — without becoming AI slop.
Concept
AI & LLM Glossary
Fifty essential AI and LLM terms defined in plain English — from agents and embeddings to RAG, RLHF, and vector databases. Your quick-reference cheat sheet.