Build a working personal Jadoo Voice artifact for Urdu voiceovers inside my own Muse app. Each reader creates and runs their own artifact in their own Muse account with their own Gemini API key. This is an implementation brief adapted from the supplied Jadoo Voice guide, updated 25 October 2026. Deliver the working artifact and source inside Muse, with instructions to open and reuse it there. A separate hosted website, public app URL or deployment is not part of this task. Do not ask for my secret key in chat; I will enter it in the finished app. 1. Verify the integration before coding Read the current official documentation: https://ai.google.dev/gemini-api/docs/speech-generation https://ai.google.dev/gemini-api/docs/generate-content/speech-generation https://ai.google.dev/gemini-api/docs/api-key https://ai.google.dev/gemini-api/docs/pricing https://ai.google.dev/gemini-api/docs/rate-limits https://ai.google.dev/gemini-api/docs/deprecations Use a currently supported TTS model and its matching API schema. At this review date, gemini-3.8-flash-tts is a current model; gemini-3.8-flash-lite-tts is an optional explicit alternative. Do not silently switch models or enable paid billing. The old guide used gemini-2.5-flash-preview-tts, which has a listed earliest shutdown date of 17 November 2026. Migrating requires checking the request format and response audio format, not just changing a string. The current 3.8 language table does not explicitly list Urdu. Do not promise official Urdu support or perfect Pakistani pronunciation. Include a short Urdu audition and ask the user to judge it before making longer recordings. Report observed results separately from documentation claims. 2. Personal BYOK architecture and truthful privacy Make a client-side artifact in Muse using the user's own Gemini API key, with calls to Google's documented API over HTTPS through a route actually supported by the artifact runtime. Verify network access, storage, playback and file export inside Muse. If the runtime blocks a required operation, explain which one and ask before changing the architecture or routing credentials through any additional service. Do not silently turn this into an externally hosted app. Keep the key in memory by default. Offer an explicit opt-in "اسی ڈیوائس پر محفوظ کریں" choice only if persistent local storage is supported inside this Muse artifact. Do not assume persistence across sessions or devices; test it and state its scope. Otherwise keep the key only for the current session and explain that it must be entered again. Include masked key input, deliberate reveal/hide, "کی آزمائیں", and "کی صاف کریں". Keep secrets out of URLs, logs, analytics, screenshots, source files, exports and error reports. Never insert a shared developer key into a public app. State plainly that the key and submitted script are sent to Google to generate audio. Clear key removes the local copy; it does not revoke the Google credential. Saving in localStorage is a convenience, not a security guarantee. Show a link to Google key management. Do not build a shared service or distribute a developer key; every user supplies their own key in their own artifact. 3. Urdu-first, accessible interface Default Urdu with proper RTL and readable Noto Nastaliq Urdu, plus an English toggle. Persist language separately from credentials; toggling must retain the current script, selected voice and style. Keep English product names, voice IDs and model IDs in isolated LTR spans. Use English digits 0-9. Use کی for API key and آفیشل for official. Proofread all Urdu labels, help and errors, including واضح and سیکھنے. Avoid clipped Nastaliq descenders and overcrowded controls. Use semantic labels, keyboard focus, large touch targets and a responsive 375px layout. Create a professional deep green, sand and gold design. Exact top-right brand wordmark: Urdu Ai, Montserrat SemiBold, Urdu white, Ai #FFBE0B, lowercase i, transparent with no box. App name: Jadoo Voice. Use numbered sections: key, text, voice/style, generation, result. Do not fabricate provider logos. 4. Script, voices and direction Provide a multiline Urdu script input, dir=auto, character count, and an explicitly rough duration estimate that updates to actual duration after generation. Never equate a fixed character count to guaranteed audio length. Warn before very long scripts and recommend a short audition. Offer the provider's current valid prebuilt voices, including Zephyr, Puck and Kore where supported. Preserve exact IDs. Use actual provider metadata when available. If adding editorial gender, age-feel or character filters, label them as app descriptions rather than verified identities or official demographic facts. Provide Expression, Pace and Accent controls and a free-editable direction field. Default to a requested Pakistani Urdu delivery, not a guaranteed result. Keep delivery instructions separate from the spoken transcript using the chosen API's documented mechanism. Keep one selected voice and direction across chunks. 5. Generation and trustworthy progress Use a short test first. Split longer scripts at sentence boundaries, targeting around 1,800 characters per chunk as an app choice, respecting the actual model limits. Do not split Urdu graphemes. Show chunk N of M, allow cancel, retain successful chunks locally, and avoid regenerating successful work unnecessarily. Use bounded retries with backoff only for transient failures. Do not retry authorization failures or exhausted daily quotas in a loop. Explain that chunks and retries may consume quota. Use real completed-chunk progress; show an indeterminate state for stages without measurable progress. Parse the documented response MIME type and encoding. Never assume all models return raw PCM. Save valid WAV responses directly; if PCM is returned, use the documented rate/channel/bit depth to build a proper WAV. Decode compatible chunks, normalize their format when needed, concatenate audio samples and encode one valid output. Do not concatenate WAV headers. Check nonempty audio, container consistency and all expected chunks before offering the result. Container checks do not prove every word was spoken; prompt the user to listen to the complete recording. 6. Clear errors and costs Translate actionable errors into Urdu and English. Explain HTTP 400 as a potentially invalid request, not always a bad key. For 401/403, check credential permissions or restrictions. For 404, check model/endpoint/access. For 429, distinguish available quota information and retry timing; link the user's AI Studio rate limits. Handle provider blocking, no audio, network issues and browser decoding failure without exposing credentials. Show only sanitized technical details for troubleshooting. Do not claim unlimited free use or a fixed daily allowance. Show the current pricing and rate-limit links. State that the selected project/model controls quota and billing. A new key in the same project does not increase quota. Free-tier data terms and builder-platform charges may differ. Never enable billing without the user's explicit authorization. 7. Audio player, download and sharing After generation show a prominent player, actual duration and file size. Offer Download WAV. Optionally encode MP3 in the browser, flush the encoder, then decode it and compare its duration to the source within max(1 second, 5%). If MP3 validation fails, retain the valid WAV and explain the MP3 issue. Do not present malformed or truncated output as ready. Offer native file sharing only when navigator.canShare confirms support for the actual audio file. Share to WhatsApp may open the system share sheet; do not promise WhatsApp is installed. Fallback: download, then attach the file in WhatsApp. Never share the API key, app session data or a temporary blob URL as though it were a public audio download. Provide contextual save help: iPhone share sheet > Save to Files; Android Downloads/Files; desktop download, or open audio and Save As if supported. Temporary browser blob URLs work only in their local context; do not label them as cross-device public links. Revoke them only after use. Verify that file suffix, MIME type and content agree. 8. Optional caption video, clearly experimental Implement only after the audio workflow works. Offer Preview Video and Download Video, portrait 720x1280 at 24fps by default, with optional 1080x1920 at 30fps. Use proper shaped RTL Nastaliq, current word highlighted and nearby words faded, a context line, audio-reactive waveform, timer and the exact Urdu Ai wordmark. Word timing may be estimated from the final recording length; explicitly label it estimated, not aligned transcription. Keep all timings within the audio duration. Long scripts can drift. Cache static layers. Choose an available codec/container combination; prefer MP4 with AAC when supported, otherwise show the actual WebM or supported format. Do not rename WebM as MP4. Use feature detection for WebCodecs and recording fallbacks; explain slower foreground rendering when needed. Do not promise faster-than-real-time export. Verify that the exported video has an audio track, decodes and has non-silent samples across representative segments. Ask the user to listen as well; signal detection is not a substitute for listening. If the output is silent, retry once with a supported recording route; if that fails, show a clear error and retain downloadable audio. Never offer a silent video as successfully complete. Report actual file size after encoding; avoid fixed compression promises. 9. Acceptance checks and handover Test short Urdu speech, a multi-chunk script, proper final sentence, one consistent voice, language toggle without data loss, save/clear credential behavior, no secret in network destinations except Google authentication, invalid request handling, quota handling, audio playback, WAV download, MP3 fallback and mobile layout. Test exported video with sound if implemented. Test actual file sharing on a supported device; mark untested devices honestly. Use this audition script: السلام علیکم! آج ہم اردو میں اپنا پہلا وائس اوور بنا رہے ہیں۔ پہلے ایک چھوٹا سا متن آزمائیں، پھر آواز سن کر اگلا قدم اٹھائیں۔ Provide a concise test report distinguishing real tests, mocked tests and checks still requiring the user's key/device. If credentials are unavailable, finish the app and test the non-network parts, but do not invent successful speech generation. Deliver the artifact in Muse, its source, dependency versions, steps to reopen it inside Muse, privacy data flow, and known runtime limitations. Do not deploy or publish an external website.