Deep dive · Architecture
The full audio-to-answer pipeline
Three services — a thin Python audio relay, a Node.js backend, and an Electron HUD — work together to turn raw microphone audio into a streaming, appendable answer card, with OpenAI's Realtime API doing the listening, transcribing, and answering in one connection.
Service 1: Python Audio Relay
Microphone capture, nothing else
The Python service's only job on this path is opening the microphone and streaming raw PCM16 audio at 24 kHz straight into a persistent connection with OpenAI's Realtime API. There's no local transcription model to load, no voice-activity-detection pass to run first, and no rolling buffer to manage — the audio goes out as it's captured.
One long-lived session per listening period
When you toggle listening on, the relay opens a single WebSocket session and configures it once — instructions, turn-detection sensitivity, and audio format — then keeps it open for as long as you're listening. There's no per-utterance connection overhead.
Service 2: OpenAI Realtime API
Server-side turn detection
OpenAI's Realtime API runs its own voice-activity detection on the incoming audio and decides when a pause means you've finished speaking — no fixed client-side silence timer to tune. If you start talking again while it's still generating a response, that response is automatically interrupted rather than left to finish answering something you've already moved past.
One call transcribes, judges, and answers
There's no separate speech-to-text step whose output gets handed to a second language-model call. The same Realtime session hears the audio, decides whether it heard a complete, answerable question, and — if so — writes the answer, all within one round trip.
Self-tagging output: [WAIT] / [NEW] / [APPEND]
Every response starts with a tag the model assigns itself. [WAIT] means it hasn't heard a complete question yet and produces no visible output. [NEW] opens a fresh answer card. [APPEND]means the interviewer is continuing the question it just answered — the model gives only the new information, since it genuinely remembers what it already said (the whole session's conversation lives server-side, not re-sent as a summary on every turn).
Service 3: Node.js Backend
Tag parsing and HUD card routing
dataHandler.js buffers incoming tokens just long enough to resolve the leading tag. A [NEW] tag opens a new question card and streams its answer into it. An [APPEND]tag routes tokens into the currently-open card instead of starting a new one — the same streaming event contract either way, so the HUD doesn't need to know the difference.
Service 4: Electron HUD
Always-on-top, content-protected overlay
The HUD is a frameless Electron window (380×460 px) pinned above all other windows at screen-saver level. setContentProtection(true) makes it invisible to every software-based screen capture tool. Socket.IO connects over ws://localhost:4000.
Streaming answer render, no restarts
question_answer_token events append directly to the answer card's text as they arrive. Because [APPEND]responses only ever add new content, a follow-up question grows the same card instead of clearing and re-rendering it — if you're mid-read, the text you've already read doesn't move.
Flow 2: Screenshot analysis
A second, parallel flow handles screenshot-based questions. screenshot-monitor.service.js polls the uploads/ directory. New images are preprocessed with Sharp (contrast enhancement, grayscale) then passed to Tesseract for OCR — done locally, no network call for this step. The extracted text is sent to OpenAI through the same streaming path and rendered in the HUD the same way.