1.5 KiB
1.5 KiB
continuous=true, interimResults=true for real-time text (iPhone Neural Engine, en-AU lang).\n3. Release: Stop, finalize text, enable Send → POST blob/text to server.\n\nOptions:\n- Client-Only STT (Fastest): Web Speech—sub-1s, offline, private. Backend just stores.\n- Server Streaming: Chunks via WebSocket → Whisper (OpenAI/local) partials back.\n- Hybrid: Client preview + server re-do for accuracy.\n\niOS Safari Fit: Full MediaRecorder/SpeechRec support (iOS 14.5+). Mic perm once.\n\nBackend Recs:\n- Node/Socket.io: Real-time easy.\n- Flask/FastAPI + SocketIO: Python ML (Whisper).\n\nFrontend Snippet:\njs\n// PTT Button + Live Text\nconst rec = new (window.SpeechRecognition || window.webkitSpeechRecognition)();\nrec.interimResults = true; rec.lang = 'en-AU';\npttBtn.onmousedown = () => rec.start();\npttBtn.onmouseup = () => rec.stop();\nrec.onresult = (e) => { /* update div with final + interim */ };\n\n\nBackend (Node Ex): Socket.io streams chunks → Whisper → emit partials.\n\nNext Steps: Prototype PWA? Custom Whisper server? Accents/privacy tweaks.\n\nStatus: Explored—ready to code/deploy.