← Back to SolveWatch

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.

Microphone
↓ PCM16 audio (24kHz)
Python Audio Relay (FastAPI)
↓ streams raw audio frames straight into a persistent WebSocket
OpenAI Realtime API (gpt-realtime)
↓ server-side VAD decides when you've finished speaking
↓ same call: transcribes, judges completeness, answers
↓ tags its own output — [WAIT] / [NEW] / [APPEND]
↓ streams response.output_text.delta tokens back
Node.js Backend (Express + Socket.IO)
↓ parses the tag, resolves which HUD card it belongs to
↓ [NEW] → new card · [APPEND] → append to the open card
↓ streams question_answer_token events
Electron HUD (always-on-top · content-protected)
↓ renders tokens as they arrive
Answer visible on screen ✓

Service 1: Python Audio Relay

1

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.

2

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

3

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.

4

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.

5

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

6

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

7

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.

8

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.

← How screenshare invisibility works← Why it's fast