feat: cache generated audio blobs in IndexedDB for instant replays - #1153
Conversation
|
@vivek0028 is attempting to deploy a commit to the itzzavdhesh's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
Next review available in: 22 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✍️ DCO Sign-off NeededHey @vivek0028! 👋 One or more commits in this PR are missing a Warning
How to fix: For the latest commit: git commit --amend --signoff
git push --force-with-leaseFor multiple commits, replace git rebase --signoff HEAD~N
git push --force-with-leaseThis comment will update automatically after you push. 🤖 VoiceForge Automation · Updates automatically on edits |
🎉 PR Ready for Mentor ReviewHey @vivek0028! 👋 Your PR passed all checks and is now in the GSSoC review queue. Note 🔗 Closing: #1062 · 📐 143 lines across 7 file(s) · 📬 Review requested @sabeenaviklar @Anushreebasics @itsdakshjain @snehkris @1754riya @Mrigakshi-Rathore @Itzzavdheshh @Nitya-003 @4f4d @lovestaco, this PR is ready for your review — please confirm scope, check behavior and tests, then approve or request changes. Important This is not an approval. Please wait for mentor feedback before expecting a merge. If changes are requested, push them to this same branch and keep the PR focused on the linked issue. 🤖 VoiceForge Automation · Updates automatically on edits |
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
🎊 PR Merged SuccessfullyHey @vivek0028! 👋 Congratulations and thank you for your contribution to VoiceForge! Note 🔗 Linked issue(s): #1062 · ✅ Marked as merged and complete Maintainers may still handle final cleanup, release notes, or follow-up tracking after the merge. 🤖 VoiceForge Automation · Updates automatically on edits |
🚀 Program
GSSoC
📝 Description
This PR significantly improves the performance of the Speech History feature by caching generated audio Blobs locally using IndexedDB.
Previously, clicking Replay on a past message in
MessageCard.jsxre-submitted the message text through theuseTTShook, triggering another voice synthesis request to the VoiceForge backend/Hugging Face inference engine. This introduced a 3–5 second delay and unnecessarily consumed server bandwidth and compute resources.With this change, generated audio is stored locally and retrieved directly from IndexedDB when replaying a message. Cached audio can therefore play instantly without another network request and remains available for offline replay.
Changes Made
IndexedDB caching (
db.js)audio_cacheobject store keyed by message ID.saveAudioBlobandgetAudioBlobhelpers.Audio capture (
useTTS.js)Blob.URL.createObjectURL()URL for playback.History ID synchronization (
useSpeechHistory.js)addMessageto reliably return the generated message ID.Instant replay (
VoiceForge.jsx&MessageCard.jsx)🔗 Related Issue
Closes #1062
🔄 Type of Change
🧪 How to Test
http://localhost:5173in a browser.voiceforge_db→audio_cache.📸 Screenshots (if applicable)
Not applicable — this change primarily affects audio caching and replay performance without introducing visual UI changes.
✅ Checklist
Summary by cubic
Caches generated TTS audio as Blobs in IndexedDB and replays from local cache for instant playback and offline support. This removes repeat synth requests and reduces backend load.
audio_cachein IndexedDB withsaveAudioBlobandgetAudioBlob.useTTSto fetch the audio Blob, return it, and use a localURL.createObjectURL()for playback.addMessagereturns an id;MessageCardpassesidto replay; replay checks cache first, falls back to TTS, then caches.Written for commit 91b789a. Summary will update on new commits.