fix: resolve Google TTS 200-character limit video render crash#287
Conversation
|
@angelina-2206 is attempting to deploy a commit to the Karan Mani Tripathi 's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
This PR addresses the video generation crash caused by Google TTS text-length limits and also cleans up several API/auth compilation issues.
Changes:
- Replaces direct
google-tts-apiusage with chunked Google TTS URL generation and audio buffer concatenation. - Uses validated request data in video generation instead of reading the request body twice.
- Removes broken duplicate auth page code and fixes small API route typing/destructuring issues.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
app/api/video/generate/route.ts |
Adds TTS chunking/audio stitching and fixes request body reuse. |
app/api/replies/vote/route.ts |
Removes duplicate body parsing after validation. |
app/api/replies/route.ts |
Uses validated numeric doubtId directly. |
app/api/replies/action/[id]/route.ts |
Removes unused destructured fields from validated data. |
app/api/doubts/route.ts |
Adds explicit array typing for reassigned doubt results. |
app/(auth)/sign-up/[[...sign-up]]/page.tsx |
Removes duplicated malformed component code and restores themed sign-up page. |
app/(auth)/sign-in/[[...sign-in]]/page.tsx |
Removes duplicated malformed component code and restores themed sign-in page. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if ((currentChunk + " " + word).trim().length > maxLen) { | ||
| if (currentChunk.trim().length > 0) { | ||
| chunks.push(currentChunk.trim()); | ||
| } | ||
| currentChunk = word; |
|
Hi there! 👋 Thanks for your contribution to DoubtDesk. It looks like there are currently some merge conflicts between your branch and the Once the conflicts are resolved and the PR is clean, we'll be able to merge it! |
…imit & middleware ip typing
Description
This PR resolves the 200-character limit crash in the Google Text-to-Speech API (
google-tts-api@0.0.6) during video generation. Long narration texts generated by the AI are now split into word-aligned chunks under 200 characters, fetched separately, and stitched together usingBuffer.concatto produce a single audio asset.Additionally, this PR:
/api/video/generateroute by replacing the doublereq.json()call with the validateddataobject.upstream/mainin auth pages, doubts, and replies API routes to restore build compilation.Related Issue
Closes #272
Type of Change
How Has This Been Tested?
npm run dev(verified withnpm run buildandnpm run test)Checklist
npm run dev)anytypes)main