Skip to content

feat: add blog-to-podcast demo - #30

Open
luke-speechify wants to merge 2 commits into
mainfrom
feat/blog-to-podcast
Open

feat: add blog-to-podcast demo#30
luke-speechify wants to merge 2 commits into
mainfrom
feat/blog-to-podcast

Conversation

@luke-speechify

Copy link
Copy Markdown
Contributor

Pairs with the upcoming speechify.ai post "Turn this blog post into a podcast episode with the Speechify API".

What it does

Paste a long-form article (plain text or simple markdown) and turn it into a podcast episode with host-quality narration from the Speechify TTS API.

  • POST /api/episode (Node runtime, SDK) chunks the text on sentence boundaries into ~500–800 char segments — packing whole paragraphs together where they fit and falling back to sentence splits ((?<=[.!?])\s+) only when a paragraph exceeds the cap, so abbreviations stay intact.
  • Optionally prepends a short "You're listening to…" intro so it opens like an episode.
  • Synthesizes each chunk with client.audio.speech (model simba-3.2, audio_format: "mp3") and returns { chunks: [{ audio, text }] } (base64 mp3).
  • Optional simple 2-voice reading: pick a guest voice and it alternates host/guest per paragraph.
  • Client plays the segments back-to-back as one continuous episode (queue advances on ended) with a playlist/progress view and a Download episode button (naive Blob concatenation of the mp3 parts — noted in the README).

Complements Speechify's podcast generation page — this is the API-first, build-it-yourself version.

Security & hosting

  • SPEECHIFY_API_KEY stays server-side in the route handler; @speechify/api is marked server-external so it never reaches the client bundle.
  • Requests are gated with Cloudflare Turnstile (fails open locally when unconfigured).
  • Input capped at 8,000 characters to keep the demo cheap (noted in the UI + README).
  • Registered for hosting: vercel.json service + rewrite, pnpm-workspace.yaml entry, and regenerated README table + site manifest.

Verification

  • pnpm --filter blog-to-podcast build ✅ (compiles, typechecks, static pages generated)
  • Live API call ✅ — synthesized a chunk with simba-3.2 / geffen_32, confirmed base64 mp3 returned (valid ID3 header, ~87 KB decoded).

Paste a long-form article and turn it into a podcast episode. A Next.js
route chunks the text on sentence boundaries into ~500-800 char segments,
optionally prepends an episode intro, and synthesizes each segment with the
Speechify TTS API (simba-3.2, mp3), returning base64 mp3 chunks. The client
plays them back-to-back as one continuous episode with a playlist and a
download button. Supports an optional 2-voice host/guest reading.

The SPEECHIFY_API_KEY stays server-side; requests are gated with Turnstile.
Input is capped at 8000 characters. Registered as a Vercel Service.
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
speechify-api-demos Ready Ready Preview Aug 21, 2026 12:17am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant