🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots 📖
TypeScript browser-extensionchrome-extensiondocumentationfirefox-extensionguide-generatorlocal-firstmanifest-v3privacy-firstproductivityreactscreenshotstep-by-step-guidetutorialtypescriptworkflowwxt
docs: record how video voice-over works
davbio3e19b0bfdc69
diff --git a/AGENTS.md b/AGENTS.mdindex 77e5527..1d11303 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -42,7 +42,8 @@ src/│ │ ├── start-notification.ts # Recording notification overlay│ │ └── step-description.ts # Fallback rule-based descriptions│ ├── blur/ # Smart blur: regex presets, DOM scanner, element picker, panel UI-│ ├── export/ # HTML, PDF, DOCX, Markdown, video generators + shared utils+│ ├── export/ # HTML, PDF, DOCX, Markdown, video/GIF generators + shared utils+│ │ └── voiceover/ # OpenAI/ElevenLabs text-to-speech for narrated video exports│ ├── transfer/ # .mimik bundle: export/import a guide between browsers│ │ ├── schema.ts # BundleManifest + validation of untrusted files│ │ ├── flatten.ts # flattenScreenshot (bakes redactions before a guide leaves)@@ -99,7 +100,7 @@ src/|-------|------|---------|| Capture lifecycle | xstate | State machine (IDLE ↔ RECORDING ↔ PAUSED) in background service worker || Fullview UI | Zustand | Search modal, guide counts, active guide data |-| Persistence | Dexie (IndexedDB) | Guides, steps, screenshots, snapshots |+| Persistence | Dexie (IndexedDB) | Guides, steps, screenshots, snapshots, cached voice clips || Service worker recovery | sessionStorage | xstate machine snapshot persistence || Background → Sidepanel | Port messaging | Real-time state broadcast || Cross-context sync | BroadcastChannel | Guide mutations (star, delete) across sidepanel/fullview |@@ -194,7 +195,7 @@ Extraction walks up from the target element to find:| Markdown | `core/export/markdown-export.ts` | Standard MD with base64 image data URLs || DOCX | `core/export/docx-export.ts` | Lazy-imported, Word-compatible || Mimik bundle | `core/transfer/bundle.ts` | `.mimik` zip: manifest + flattened screenshots + README.md. Re-importable; the others are one-way |-| Video | `core/export/video-export.ts` | WebCodecs via mediabunny (lazy), mp4/H.264 with WebM/VP9 fallback |+| Video | `core/export/video-export.ts` | WebCodecs via mediabunny (lazy), mp4/H.264 with WebM/VP9 fallback, optional voice-over || GIF | `core/export/gif-export.ts` | gifenc (lazy), same frame timeline as the video; user picks Small/Medium/Large from `GIF_SPECS` |Video frames reuse `renderScreenshot`, so the auto-crop, click-target outline, annotations and@@ -212,6 +213,69 @@ behind it. Encoding yields to the event loop every few frames to keep the tab reto a Web Worker crashed the renderer with `KILLED_BAD_MESSAGE` on the first `postMessage` and isunexplained.+### Video voice-over (`core/export/voiceover/`)++Off by default. With a key in settings and the export toggle on, every step description — plus the+guide title over the cover card — is spoken and muxed in as one mono track (AAC for mp4, Opus for+WebM).++`providers.ts` is the registry, shaped like `AI_PROVIDERS`: OpenAI (`/audio/speech`, fixed voice+list) and ElevenLabs (`/text-to-speech/{voice}`, per-account catalog via `listVoices`). Both return+mp3. OpenAI is the default because most users already hold that key, and `resolveVoiceoverConfig`+borrows it from AI Descriptions on the same terms `resolveVoiceApiKey` uses — both sides OpenAI, or+nothing. **Holding a key never turns narration on**; `exportOptions.voiceover` defaults to false and+only the user flips it. Keys are stored per provider (`voiceoverApiKeys`) so switching does not lose+one, and a voice id is validated against the provider that issued it — an ElevenLabs id selected+under OpenAI falls back to OpenAI's default rather than being sent and rejected. ElevenLabs ids are+taken on trust, since the account catalog is larger than the shipped list.++The clips are synthesised *before the first frame is drawn*, because their lengths decide the+timeline: a step whose narration outruns the 5.23s animation holds its final, zoomed-in frame until+the voice finishes (`voiceTimeline` in `video-support.ts`; `VOICE_LEAD_SEC` in, `VOICE_TAIL_SEC`+out). `composeGuideFrames` therefore works from per-step spans (`stepSpans`/`stepStarts`) rather than+a fixed stride, and `videoChapters` is handed the same timeline so the chapter marks still line up.+With no timeline the spans collapse back to the uniform layout, which is what GIF still uses — GIF has+no audio and is never narrated.++Every animation helper saturates at the end of its window, so the extra frames are a still hold and+need no special case. `voiceTrackPieces` measures each gap from an absolute sample position, so the+rounding cannot drift over a long guide, and a clip that overruns its slot pushes the rest later+instead of being cut.++Narration never fails an export. No key, no AAC/Opus encoder, nothing to say, or the API itself+refusing — all log and fall back to a silent video on the structural timeline, so the stretched+timeline only ever exists when a track was actually produced. The failure is reported back on+`VideoExportResult.voiceoverError` and the export panel says the video came out silent, because+dropping paid-for narration without telling anyone is worse than the error. A user abort is the one+thing `narrateOrSkip` rethrows — cancelling an export must still cancel it.++Only the dashboard's export panel can turn narration on. `ExportMenu` in the side panel passes+`voiceover: false` explicitly rather than inheriting the saved option, because that surface has no+toggle and no indicator: a stored preference must not spend money somewhere the user cannot see or+stop it. A rejected key's response body is never repeated into the error, since OpenAI echoes part of+the key back in its 401. Clips are cached in Dexie (`voiceClips`, keyed by provider++ voice + model + text hash, 500 most recent; the row type lives in `core/guides/types.ts` with the+rest of the schema) because the preview re-encodes on every option change+and each miss is a paid API call. The key is read in the export page, not the background: synthesis+is cancellable through the same AbortSignal the encoder uses. `listVoices` does go through the+background, next to `validateApiKey`.++`VideoStepPlayer` was written for a silent video: `autoPlay` plus a hard-coded `muted`, and a control+bar with no volume affordance. Narrated previews flip both — a browser will not autoplay with sound,+so a narrated preview waits for the play button and that gesture buys it audio from the first frame,+while a silent one still autoplays muted as before. The mute toggle is there in both cases.++The export panel shows the voice-over control under Video quality wherever video export is possible,+not only on the video preview tab — a guide can be exported to video from the format list without+ever opening that tab. The length estimate appears only once voice-over is on; the estimate's second figure comes from the rendered chapters, so it is the+real narrated length rather than a guess. `videoSeconds` in `video-support.ts` gives the first.++Deliberately out of scope: rephrasing step text for speech (the descriptions are narrated verbatim —+a spoken rewrite was considered and dropped), local/WASM TTS (86-330MB of ONNX weights, `wasm-unsafe-eval`, and+runtime model fetches have drawn Web Store "remotely hosted code" rejections), and muxing the user's+own recorded narration — the mic PCM reaches `runNarrationPipeline` and is discarded, and persisting+it is a separate bet, not a blocker.+## Tech Stack| Layer | Technology |@@ -225,7 +289,7 @@ unexplained.| State (UI) | Zustand || Storage | Dexie.js (IndexedDB) || Messaging | webext-core |-| Export | jsPDF, docx, mediabunny (WebCodecs video), gifenc (GIF), client-side HTML/Markdown |+| Export | jsPDF, docx, mediabunny (WebCodecs video), gifenc (GIF), ElevenLabs (voice-over), client-side HTML/Markdown || AI (optional) | Vercel AI SDK (`ai`, `@ai-sdk/openai`, `@ai-sdk/anthropic`) || Event queue | p-queue (concurrency: 1) || Icons | Lucide React |diff --git a/README.es.md b/README.es.mdindex 44043b1..1b64d04 100644--- a/README.es.md+++ b/README.es.md@@ -37,6 +37,7 @@ Le das a grabar, haces lo tuyo, y obtienes una guía pulida con capturas anotada- [▶️ Reproducción Guide Me](#️-reproducción-guide-me)- [🎙️ Narración por voz (opcional)](#️-narración-por-voz-opcional)- [✏️ Editor de guías](#️-editor-de-guías)+ - [🔊 Voz en off del vídeo (opcional)](#-voz-en-off-del-vídeo-opcional)- [📤 Exportación multi-formato](#-exportación-multi-formato)- [🔐 Privacidad y almacenamiento](#-privacidad-y-almacenamiento)- [🤝 Contribuir](#-contribuir)@@ -181,11 +182,22 @@ vuelve atrás con el historial de versiones.</div>+### 🔊 Voz en off del vídeo (opcional)++Actívala en el panel de exportación y cada paso del vídeo se leerá en voz alta, con tu propia clave+de OpenAI o ElevenLabs. Si ya configuraste una clave de OpenAI para las descripciones con IA, Mimik+la reutiliza: no hay que registrarse en nada más. Los pasos narrados permanecen en pantalla hasta que+la voz termina, así que nada se corta, y los clips se guardan en caché local para que volver a+exportar la misma guía no cueste nada.++Desactivada por defecto: tener una clave nunca activa la narración; lo haces tú.+### 📤 Exportación multi-formatoComparte tus guías en el formato que mejor encaje con tu flujo:-- **Video**: recorrido narrado, mp4/H.264, con el cursor moviéndose a cada objetivo+- **Video**: recorrido narrado, mp4/H.264, con el cursor moviéndose a cada objetivo — opcionalmente con una+ voz en off de ElevenLabs que lee cada paso, lo que además hace el vídeo apto para la Sección 508- **PDF**: listo para imprimir, A4 vertical con saltos automáticos- **DOCX**: ábrelo y sigue editando en Word- **HTML**: autónomo, comparte donde sea, imágenes embebidas en base64@@ -207,7 +219,7 @@ Tus guías, pasos y capturas viven en tu dispositivo. No hay backend, no hay cueSi estás enmascarando datos personales antes de compartir una guía, lee primero [lo que Smart Blur no cubre](#-smart-blur): no alcanza iframes, shadow DOM ni texto dibujado dentro de imágenes.-Dos cosas sí salen del navegador, ambas documentadas en la [política de privacidad](https://mimik.westpoint.io/privacy/): los iconos de los sitios se piden al servicio de favicons de Google, lo que envía el dominio de ese sitio, y las funciones opcionales de IA y voz mandan texto o audio al proveedor que configuraste.+Dos cosas sí salen del navegador, ambas documentadas en la [política de privacidad](https://mimik.westpoint.io/privacy/): los iconos de los sitios se piden al servicio de favicons de Google, lo que envía el dominio de ese sitio, y las funciones opcionales de IA, narración por voz y voz en off mandan texto o audio al proveedor que configuraste: la voz en off envía el texto de cada paso al exportar, y solo si la activas.<div align="right">diff --git a/README.fr.md b/README.fr.mdindex ee4de75..b951418 100644--- a/README.fr.md+++ b/README.fr.md@@ -37,6 +37,7 @@ Clique sur enregistrer, fais ce que tu as à faire, et récupère un guide soign- [▶️ Lecture Guide Me](#️-lecture-guide-me)- [🎙️ Narration vocale (optionnel)](#️-narration-vocale-optionnel)- [✏️ Éditeur de guides](#️-éditeur-de-guides)+ - [🔊 Voix off de la vidéo (option)](#-voix-off-de-la-vidéo-option)- [📤 Export multi-format](#-export-multi-format)- [🔐 Confidentialité et stockage](#-confidentialité-et-stockage)- [🤝 Contribuer](#-contribuer)@@ -181,11 +182,22 @@ réordonne ou supprime en lot, et reviens en arrière via l'historique de versio</div>+### 🔊 Voix off de la vidéo (option)++Activez-la dans le panneau d'export et chaque étape de la vidéo est lue à voix haute, avec votre+propre clé OpenAI ou ElevenLabs. Si vous avez déjà renseigné une clé OpenAI pour les descriptions IA,+Mimik la réutilise : rien d'autre à créer. Les étapes narrées restent à l'écran jusqu'à la fin de la+voix, donc rien n'est coupé, et les clips sont mis en cache localement pour que réexporter le même+guide ne coûte rien.++Désactivée par défaut : posséder une clé n'active jamais la narration, c'est vous qui l'activez.+### 📤 Export multi-formatPartage tes guides dans le format qui colle à ton flux :-- **Vidéo** : parcours narré, mp4/H.264, avec le curseur qui se déplace vers chaque cible+- **Vidéo** : parcours narré, mp4/H.264, avec le curseur qui se déplace vers chaque cible — au choix avec une+ voix off ElevenLabs qui lit chaque étape, ce qui rend aussi la vidéo conforme à la Section 508- **PDF** : prêt à imprimer, A4 portrait avec sauts de page auto- **DOCX** : ouvre-le et continue dans Word- **HTML** : autonome, à partager partout, images intégrées en base64@@ -207,7 +219,7 @@ Tes guides, étapes et captures restent sur ton appareil. Pas de backend, pas deSi tu masques des données personnelles avant de partager un guide, lis d'abord [ce que Smart Blur ne couvre pas](#-smart-blur) : il n'atteint ni les iframes, ni le shadow DOM, ni le texte dessiné dans une image.-Deux choses sortent bien du navigateur, toutes deux documentées dans la [politique de confidentialité](https://mimik.westpoint.io/privacy/) : les icônes de sites sont récupérées via le service de favicons de Google, ce qui envoie le domaine du site, et les fonctions optionnelles d'IA et de voix envoient du texte ou de l'audio au fournisseur que tu as configuré.+Deux choses sortent bien du navigateur, toutes deux documentées dans la [politique de confidentialité](https://mimik.westpoint.io/privacy/) : les icônes de sites sont récupérées via le service de favicons de Google, ce qui envoie le domaine du site, et les fonctions optionnelles d'IA, de narration vocale et de voix off envoient du texte ou de l'audio au fournisseur que tu as configuré — la voix off envoie le texte de chaque étape au moment de l'export, et seulement si tu l'actives.<div align="right">diff --git a/README.md b/README.mdindex c49dae7..99bcfd8 100644--- a/README.md+++ b/README.md@@ -37,6 +37,7 @@ Click record, do the thing, get a polished guide with annotated screenshots. Nar- [▶️ Guide Me replay](#️-guide-me-replay)- [🎙️ Voice narration (optional)](#️-voice-narration-optional)- [✏️ Guide editor](#️-guide-editor)+ - [🔊 Video voice-over (optional)](#-video-voice-over-optional)- [📤 Multi-format export](#-multi-format-export)- [📦 Share a guide](#-share-a-guide)- [🔐 Privacy & storage](#-privacy--storage)@@ -183,11 +184,21 @@ through version history.</div>+### 🔊 Video voice-over (optional)++Turn it on in the export panel and every step of a video export is read aloud, using your own OpenAI+or ElevenLabs key. If you already set an OpenAI key for AI descriptions, Mimik reuses it — there is+nothing else to sign up for. Narrated steps hold on screen until the voice finishes, so nothing gets+cut off, and clips are cached locally so re-exporting the same guide costs nothing.++Off by default: holding a key never turns narration on, you do.+### 📤 Multi-format exportShare guides in whatever format fits your workflow:-- **Video**: narrated walkthrough, mp4/H.264, with the cursor moving to each target+- **Video**: narrated walkthrough, mp4/H.264, with the cursor moving to each target — optionally with an+ OpenAI or ElevenLabs voice-over reading every step aloud, which also makes the export usable under Section 508- **GIF**: short looping clip for a chat thread or an issue comment- **PDF**: print-ready, A4 portrait with auto page breaks- **DOCX**: open and keep editing in Word@@ -242,7 +253,7 @@ Guides, steps, and screenshots live on your device. There's no backend, no accouIf you are masking personal data before sharing a guide, read [what Smart Blur does not cover](#-smart-blur) first — it cannot reach iframes, shadow DOM, or text drawn into images.-Two things do leave the browser, both documented in the [privacy policy](https://mimik.westpoint.io/privacy/): site icons are fetched from Google's favicon service, which sends that site's domain, and the optional AI and voice features send text or audio to the provider you configured.+Two things do leave the browser, both documented in the [privacy policy](https://mimik.westpoint.io/privacy/): site icons are fetched from Google's favicon service, which sends that site's domain, and the optional AI, voice narration and video voice-over features send text or audio to the provider you configured — voice-over sends each step's text at export time, and only when you turn it on.<div align="right">diff --git a/README.pt-BR.md b/README.pt-BR.mdindex a70620c..8871843 100644--- a/README.pt-BR.md+++ b/README.pt-BR.md@@ -37,6 +37,7 @@ Clica em gravar, faz o que precisa, e recebe um guia caprichado com capturas de- [▶️ Reprodução Guide Me](#️-reprodução-guide-me)- [🎙️ Narração por voz (opcional)](#️-narração-por-voz-opcional)- [✏️ Editor de guias](#️-editor-de-guias)+ - [🔊 Narração do vídeo (opcional)](#-narração-do-vídeo-opcional)- [📤 Exportação multi-formato](#-exportação-multi-formato)- [🔐 Privacidade e armazenamento](#-privacidade-e-armazenamento)- [🤝 Contribuir](#-contribuir)@@ -181,11 +182,21 @@ volta atrás pelo histórico de versões.</div>+### 🔊 Narração do vídeo (opcional)++Ative no painel de exportação e cada passo do vídeo será lido em voz alta, com sua própria chave da+OpenAI ou ElevenLabs. Se você já configurou uma chave da OpenAI para as descrições com IA, o Mimik+reaproveita — não há mais nada para assinar. Passos narrados ficam na tela até a voz terminar, então+nada é cortado, e os clipes ficam em cache local para que reexportar o mesmo guia não custe nada.++Desligada por padrão: ter uma chave nunca liga a narração; você liga.+### 📤 Exportação multi-formatoCompartilha os guias no formato que melhor cabe no teu fluxo:-- **Vídeo**: passo a passo narrado, mp4/H.264, com o cursor indo até cada alvo+- **Vídeo**: passo a passo narrado, mp4/H.264, com o cursor indo até cada alvo — opcionalmente com uma+ narração da ElevenLabs lendo cada passo, o que também deixa o vídeo adequado à Seção 508- **PDF**: pronto pra imprimir, A4 retrato com quebras de página automáticas- **DOCX**: abre e continua editando no Word- **HTML**: autônomo, compartilha em qualquer lugar, imagens embutidas em base64@@ -207,7 +218,7 @@ Teus guias, passos e capturas ficam no teu dispositivo. Sem backend, sem conta,Se tu está mascarando dados pessoais antes de compartilhar um guia, lê primeiro [o que o Smart Blur não alcança](#-smart-blur): ele não chega em iframes, shadow DOM nem texto desenhado dentro de imagens.-Duas coisas saem do navegador, as duas documentadas na [política de privacidade](https://mimik.westpoint.io/privacy/): os ícones dos sites são buscados no serviço de favicons do Google, o que envia o domínio daquele site, e os recursos opcionais de IA e voz mandam texto ou áudio pro provedor que tu configurou.+Duas coisas saem do navegador, as duas documentadas na [política de privacidade](https://mimik.westpoint.io/privacy/): os ícones dos sites são buscados no serviço de favicons do Google, o que envia o domínio daquele site, e os recursos opcionais de IA, narração por voz e narração do vídeo mandam texto ou áudio pro provedor que tu configurou — a narração do vídeo envia o texto de cada passo na hora de exportar, e só se tu ligar.<div align="right">diff --git a/README.zh-CN.md b/README.zh-CN.mdindex 587aa63..e83116e 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -37,6 +37,7 @@- [▶️ Guide Me 回放](#️-guide-me-回放)- [🎙️ 语音讲解(可选)](#️-语音讲解可选)- [✏️ 指南编辑器](#️-指南编辑器)+ - [🔊 视频配音(可选)](#-视频配音可选)- [📤 多格式导出](#-多格式导出)- [🔐 隐私与存储](#-隐私与存储)- [🤝 贡献](#-贡献)@@ -177,11 +178,20 @@ Mimik 可以在几秒内把任何重复性的浏览器任务变成一份可分</div>+### 🔊 视频配音(可选)++在导出面板中开启后,视频的每个步骤都会被朗读出来,使用你自己的 OpenAI 或 ElevenLabs 密钥。如果你+已经为 AI 描述配置了 OpenAI 密钥,Mimik 会直接复用,无需再注册其他服务。有配音的步骤会一直停留到+语音结束,因此不会被截断;音频片段会缓存在本地,重新导出同一份指南不会产生额外费用。++默认关闭:拥有密钥并不会自动开启配音,需要你手动开启。+### 📤 多格式导出你可以按工作流需要,用不同格式分享指南:-- **视频**:带讲解的 walkthrough,mp4/H.264,光标会移动到每个目标元素+- **视频**:带讲解的 walkthrough,mp4/H.264,光标会移动到每个目标元素 —— 可选启用 ElevenLabs 配音朗读每个步骤,+ 同时让视频满足第 508 条无障碍要求- **PDF**:适合打印,A4 纵向,自动分页- **DOCX**:可在 Word 中打开并继续编辑- **HTML**:自包含文件,可在任何地方分享,图片以内嵌 base64 保存@@ -203,7 +213,7 @@ Mimik 可以在几秒内把任何重复性的浏览器任务变成一份可分如果你在分享指南前需要遮盖个人数据,请先读一下[智能模糊覆盖不到的内容](#-智能模糊):它无法触及 iframe、shadow DOM,也无法触及画在图片里的文字。-有两类内容会离开浏览器,并且都已在[隐私政策](https://mimik.westpoint.io/privacy/)中说明:网站图标会从 Google favicon 服务获取,这会发送对应网站的域名;可选的 AI 和语音功能会把文本或音频发送给你配置的服务商。+有两类内容会离开浏览器,并且都已在[隐私政策](https://mimik.westpoint.io/privacy/)中说明:网站图标会从 Google favicon 服务获取,这会发送对应网站的域名;可选的 AI、语音讲解和视频配音功能会把文本或音频发送给你配置的服务商 —— 视频配音会在导出时发送每个步骤的文本,且仅在你开启后才会发送。<div align="right">