DEV Community

Cover image for How to Make a NotebookLM-Style Two-Host AI Podcast from Any PDF or URL (Open Source)
Miragea
Miragea

Posted on

How to Make a NotebookLM-Style Two-Host AI Podcast from Any PDF or URL (Open Source)

NotebookLM's Audio Overviews made a lot of people want the same thing: drop in an article or a PDF and get back two hosts actually talking about it. Once you try to use that for a real show, you hit the limits quickly. You can't read or edit the script, you can't pick the voices, and you get no chapters, no transcript file and no RSS feed.

This tutorial builds that pipeline with open-source tools you control. You'll go from a URL, PDF or topic to a finished, publish-ready two-host episode, with a script you can edit, a distinct voice for each host, real interruptions and laughs, chapters, SRT/VTT transcripts and a podcast feed.

Banner for miragea-podcast: two AI hosts, Alex and Sam, with waveforms, next to the files the tool writes: MP3 with chapters, SRT/VTT transcript, chapters JSON, show notes and a Podcasting 2.0 RSS feed

What is an AI podcast generator?

An AI podcast generator turns written material into a spoken conversation. It does three jobs: it writes a script that sounds like people talking rather than an essay read aloud, it voices each speaker with a different voice, and it produces the result into an audio file and the files podcast apps expect (chapters, transcript, feed). The tool used here, miragea-podcast (MIT), handles the voicing and production. Writing is left to whichever model you already use (Claude, GPT, a local LLM) or to your AI agent directly. The voices come from the Miragea API, so there's no GPU or local TTS model to install.

Hear the result first

Here is an 85-second episode made in one run from a hand-written Markdown script (script):

Animated preview of the demo episode: a waveform moves while captions show Alex and Sam talking about why songs get stuck in your head

The two voices are cloned on the fly from short CMU ARCTIC recordings (free for any use, commercial included). Notice the interruption near the end of the second chapter ("Wait, so finishing the song can help?"): the second host really does start talking before the first one finishes.

Step 1: Install

You need Python 3.10+ and ffmpeg.

pipx install miragea-podcast       # or prefix every command with: uvx
export MIRAGEA_API_KEY=...         # create one at https://miragea.ai/workspace/api
miragea-podcast doctor             # free: checks the key, the API and ffmpeg
Enter fullscreen mode Exit fullscreen mode

Step 2: Get a script brief

Podcast scripts fail in predictable ways: long monologues, no reactions, invented statistics. The prompt command prints a brief that heads those off. It also pulls the readable text out of a URL or PDF and appends it:

miragea-podcast prompt https://en.wikipedia.org/wiki/Earworm --minutes 5 --style deep-dive > brief.txt
Enter fullscreen mode Exit fullscreen mode

Paste brief.txt into any chat model, or let your agent read it. Six styles are built in: deep-dive, debate, interview, explainer, news-brief and panel (3 to 6 voices). The length target is 150 spoken words per minute.

Step 3: The script format

The model returns plain Markdown you can read and fix before spending anything:

---
title: "Why Songs Get Stuck in Your Head"
description: "Two hosts dig into earworms and the odd trick that can shut them up."
language: en
---

## Cold open
Alex: [excited] Okay, quick confession. I've had the same eight seconds of a cereal jingle looping in my head since Tuesday.
Sam: [laughs] Since Tuesday? That's not a song anymore, that's a roommate.

## Why it happens
Alex: Your brain keeps replaying a few seconds because it never got to the end.
Sam: [interrupts] Wait, so finishing the song can help?
Alex: [overlap] For some people, yes!
[pause 0.5s]
Enter fullscreen mode Exit fullscreen mode
  • ## Heading becomes a chapter in the MP3, the show notes and the feed.
  • Tags like [laughs], [sighs], [whispers] and [excited] change delivery. miragea-podcast tags lists them all.
  • [interrupts] and [overlap] also change timing: that turn starts before the previous voice has finished. This is the biggest difference from tools that just play turns one after another.

Step 4: Pick a voice per host, then plan for free

Each speaker needs a voice. It can be one saved in your Miragea account (Alex=actor:ID or Alex=VoiceName), or a clone made from a public sample URL plus the exact words spoken in it:

miragea-podcast plan episode.md \
  --host "Alex=https://example.com/alex.wav|Exact words spoken in alex.wav." \
  --host "Sam=https://example.com/sam.wav|Exact words spoken in sam.wav."
Enter fullscreen mode Exit fullscreen mode

plan is free. It validates speakers and tags, splits long turns at sentence boundaries, and prints the number of requests and a credit estimate. Add --max-credits N to any real run and it will refuse to go over budget. Only clone voices you have the right to use. Your own is the obvious choice for a personal show.

Step 5: Make the episode

miragea-podcast make episode.md --host "Alex=..." --host "Sam=..." \
  --intro-music chime --outro-music chime -o ./episodes
Enter fullscreen mode Exit fullscreen mode

Terminal capture of the real run: plan with 2 speakers and 207 words, 15 segments voiced, mixing and mastering, then the MP3 path, an 84.898 second duration and three chapters at 0, 22 and 50 seconds

Behind that one command:

  1. Segments are voiced in parallel. Each request carries a deterministic idempotency key and lands in a local cache, so if your Wi-Fi drops halfway, running the same command again reuses everything already finished.
  2. Silence is trimmed, natural gaps are added between speakers, and interrupting turns are placed so they overlap the previous one.
  3. The mix is mastered to -16 LUFS, the usual loudness target for podcasts.
  4. ID3 chapters and the transcript are embedded in the MP3.

Waveform of the finished 85-second MP3 with yellow chapter markers for Cold open, Why it happens, and How to make it stop

You get the MP3 plus .srt, .vtt, .txt and Podcasting 2.0 .transcript.json files, .chapters.json, .shownotes.md, and an .rss-item.xml. As a sanity check, I ran the finished MP3 back through speech recognition. It matched the script word for word except for one homophone ("cereal" came back as "serial").

Step 6: Publish it as a real podcast

Upload the folder to any static host (S3, R2, Netlify, Pages), then:

miragea-podcast feed ./episodes --base-url https://cdn.example.com/show \
  --title "Curious Minutes" --author "You" --image https://cdn.example.com/show/art.jpg
Enter fullscreen mode Exit fullscreen mode

That writes an RSS 2.0 feed with iTunes tags and Podcasting 2.0 transcripts, chapters and host credits. You can submit it to Apple Podcasts, Spotify for Creators or the Podcast Index.

Let your AI agent do all of it (MCP)

If you use Claude Desktop, Claude Code, Cursor or VS Code, skip the copy-paste. The package includes an MCP server, and the agent writes the script itself, so you don't need a second LLM key:

claude mcp add miragea-podcast -e MIRAGEA_API_KEY=<your-key> -- uvx --from miragea-podcast miragea-podcast-mcp
Enter fullscreen mode Exit fullscreen mode

Then ask: "Turn https://example.com/article into a 5-minute two-host podcast with Alex and Sam." The agent calls read_source, follows script_guide, checks its work with plan_podcast and renders with create_podcast. There's also an Agent Skill version for SKILL.md-aware agents in the miragea-skills collection.

How it compares

miragea-podcast NotebookLM Audio Overviews podcastfy
Open source Yes (MIT) No Yes (Apache-2.0)
Edit the script before voicing Yes, Markdown No Yes
Choose or clone each host's voice Yes No Depends on TTS provider
Overlapping speech / interruptions Yes Yes No
Chapters, SRT/VTT, RSS Built in No Transcript only
MCP server for agents Yes No No

NotebookLM is still the fastest way to get a one-off overview for yourself, with zero setup. If you want something you can publish, brand and automate, owning the script and the voices matters more.

FAQ

How do I turn a PDF into a podcast? Run miragea-podcast prompt paper.pdf, have any LLM write the script from the brief, then miragea-podcast make. If PODCAST_LLM_API_KEY is set, miragea-podcast create paper.pdf --host ... --host ... does both steps.

Can I be one of the hosts? Yes. Record 10 to 30 seconds of clean speech, host it at a public URL and pass --host "Me=https://.../me.wav|what you said".

Can I try it without spending anything? plan and make --preview are free. Preview renders the whole timeline with placeholder tones, so you can check pacing and chapters first.

The code, tests (36, fully offline) and the demo are on Codeberg, and the package is on PyPI. Issues and pull requests are welcome.

Top comments (0)