feat: add blog-to-podcast demo - #30
Open
luke-speechify wants to merge 2 commits into
Open
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.client.audio.speech(modelsimba-3.2,audio_format: "mp3") and returns{ chunks: [{ audio, text }] }(base64 mp3).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_KEYstays server-side in the route handler;@speechify/apiis marked server-external so it never reaches the client bundle.vercel.jsonservice + rewrite,pnpm-workspace.yamlentry, and regenerated README table + site manifest.Verification
pnpm --filter blog-to-podcast build✅ (compiles, typechecks, static pages generated)simba-3.2/geffen_32, confirmed base64 mp3 returned (valid ID3 header, ~87 KB decoded).