Skip to content

feat: add clone-voice-10s demo - #27

Open
luke-speechify wants to merge 3 commits into
mainfrom
feat/clone-voice-10s
Open

feat: add clone-voice-10s demo#27
luke-speechify wants to merge 3 commits into
mainfrom
feat/clone-voice-10s

Conversation

@luke-speechify

Copy link
Copy Markdown
Contributor

Pairs with the upcoming speechify.ai post "Clone a voice from 10 seconds and ship it today".

What it does

A one-page Next.js demo for zero-shot voice cloning from a short (~10 second) sample, with consent as a first-class step:

  • Clone → speak → delete in one click. Clone a voice from the sample, immediately synthesize with the clone, then auto-delete the clone so it never lingers in the workspace (the UI surfaces the deletion).
  • Sample guidance. The UI explains a 10 to 30 second WAV of one speaker works best, and ships fixtures/spacewalk.wav (public-domain NASA audio) so you can run the whole flow without recording anything.
  • Explicit consent gate. A required checkbox ("I have the speaker's consent to clone this voice") plus the consenting person's full name and email. Cloning is blocked, client and server side, until consent is confirmed, and the identity is passed as consent: JSON.stringify({ fullName, email }).
  • Links the Voice Cloning Consent and Safety page and acknowledges the Voice cloning now verifies consent announcement.

How it works

  • Three nodejs-runtime routes hold SPEECHIFY_API_KEY server-side, never exposing it to the browser: POST /api/clone (client.voices.create, catches SpeechifyError 402 with a friendly "not on your plan" message), POST /api/speak (client.audio.speech, simba-english), and DELETE /api/voice?id=… (client.voices.delete).
  • All three are gated with Cloudflare Turnstile (verifyTurnstile), and the client attaches an x-turnstile-token header to every gated fetch.
  • @speechify/api is marked serverExternalPackages so the SDK never enters the client bundle.

Hosting registration

  • vercel.json — added a clone-voice-10s service and a /clone-voice-10s/:path* rewrite (before the / and catch-all rewrites).
  • pnpm-workspace.yaml — added demos/clone-voice-10s.
  • Ran pnpm generate to refresh the README table and site manifest. Dev port 8772.

Verification

  • pnpm --filter clone-voice-10s build
  • Live API ✅ — ran the full clone → speak (simba-english) → delete flow against the real API with the shipped spacewalk.wav; all three steps returned successfully. The 402 path returns a clean plan message when cloning is not on the key's plan.

Zero-shot voice cloning from a ~10 second sample with an explicit consent
gate, immediate synthesis with the clone, and auto-delete afterwards.
Three Node-runtime routes (clone, speak, delete) hold the Speechify key
server-side and are gated with Turnstile. Registered as a Vercel Service
under /clone-voice-10s.
@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:24am

Request Review

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deployment failed for project speechify-api-demos with the following error:

The `vercel.json` schema validation failed with the following message: `services` should match pattern "^[a-z]([a-z_-]*[a-z])?$"

Learn More: https://vercel.com/docs/concepts/projects/project-configuration

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown

Deployment failed for project speechify-api-demos with the following error:

The `vercel.json` schema validation failed with the following message: `services` should match pattern "^[a-z]([a-z_-]*[a-z])?$"

Learn More: https://vercel.com/docs/concepts/projects/project-configuration

Vercel service names must match ^[a-z]([a-z_-]*[a-z])?$ (no digits), so the
service key clone-voice-10s failed vercel.json schema validation and the
preview never built. Rename the service to clone-voice-ten-s; the slug, URL
path (/clone-voice-10s), and folder root are unchanged.
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