Spaces:
Running on Zero
Running on Zero
Commit History
-
fix(01-11): resume the AudioContext inside the gesture, refuse to speak on a stopped clock
The owner heard nothing on a phone. The only resume() on the turn path was in playBuffer, after the ~7 s server round trip and therefore outside the tap's user activation; a browser that gates audio behind a gesture (iOS Safari, Chromium in a cross-origin embed) leaves the context suspended, and Chromium keeps a blocked resume() promise pending forever, so the page sat on "speaking..." in silence. - stagePort gains a seventh method, unlockAudio(): synchronous, issues resume() in the caller's own call stack (inline), or relays it to the frame (iframe; stage.html handles 'avatar:unlockAudio') - turn-loop.js calls it as the FIRST statement of dispatchTurn, replay, requestSlower and startListening, before any await; host.js calls avatar.unlockAudio() first thing in all six gesture handlers, and the facade exposes it so a host can pre-unlock on any tap - playBuffer bounds its own resume() (RESUME_GRACE_MS) and, if the context is still not running, emits 'error' where: 'audio' a…6b68c4d
-
feat(01-07): add tiered browser ASR and wire push-to-talk into the shared turn loop
- avatar/asr.js: transformers.js 4.2.0 from a pinned esm.sh URL, WebGPU when an adapter really exists and WASM when it does not, announcing the active tier - avatar/turn-loop.js: startListening/stopListening implemented once, imports mic.js and asr.js itself so BOTH transports gained push-to-talk with zero changed lines - avatar/facade.js: fan out events to turnLoop.observe so the loop learns speech-start and speech-end without either transport knowing about the mic - measured A/B over three models and three clips: default is whisper-base at q4 (135.8 MB, 779 ms WebGPU / 3636 ms WASM, CER 0.023), better-accuracy is whisper-large-v3-turbo at q4f16 (537.4 MB, CER 0.000) - two measured defects recorded in docs/ASR-TIERS.md: q8/int8/quantized cannot create a session on the WASM backend at all, and a failed WebGPU init poisons the ONNX Runtime backend registry so catch-and-retry is not a working fallback - no remote ASR path exists; a seam guard fails the build if one appearsb4ca58d