DEV Community

Cover image for Hold the Floor: a voice agent that can see you're not finished yet
Hassan Imam
Hassan Imam Subscriber

Posted on

Hold the Floor: a voice agent that can see you're not finished yet

Presage SmartSpectra SDK Challenge Submission

This is a submission for the Presage SmartSpectra SDK Challenge

What I Built

Voice assistants decide you have finished talking after a fixed stretch of silence, usually somewhere between 0.7 and 2 seconds. That works until you pause in the middle of a sentence: to think, to find a word in a second language, to take a breath, or because of a stutter. Then the assistant cuts in. A longer timer helps those pauses, but it makes every single reply slower.

A 2-second timer declares "your turn is over" in the middle of a 3-second thinking pause

Hold the Floor uses the camera to tell a pause from an ending. The microphone still finds each silence. Presage SmartSpectra tells the app whether you look like you are still mid-turn:

  • lips pressed together, or set and parted for the next word
  • still talking (mouth movement, plus SmartSpectra's talking signal)
  • breathing in (SmartSpectra's chest breathing trace)
  • head turned away, as people do while they think

While any of these is on, the agent holds its reply, for up to 8 seconds. When they relax, it replies quickly. If the camera can't see you clearly (face lost, chest out of view, a second face, too dark), the cues pause and it falls back to a plain 2-second timer. It never guesses a cue it can't see.

It is an Electron desktop app with a patient interviewer (spoken questions, large type), so you can try it end to end. Fixed 0.7, 2, 3 and 4-second timers run in the shadow on the same live input, so every session ends with a fair score: how often each policy would have cut you off, and how long each made you wait. A comparison view shows the 2-second timer next to Hold the Floor while you talk. Builders of voice agents can use the decisions through a local end_of_turn WebSocket API.

It is a conversation tool, not a therapy or medical tool. It does not detect, rate or treat stuttering or any condition, and it does not judge what you say. It has not yet been tested by people who stutter.

Demo

Try it in your browser: hassan-2050.github.io/hold-the-floor. Press Watch replay to run the session from the videos through the same engine, with no install, camera or key. The live app itself runs on your computer (see Code).

The web replay page: Watch replay runs a recorded live session in the browser

Live demo (2:49). Recorded in the app with the real camera, microphone and SmartSpectra SDK:

  • 0:42 Calibration: 10 s at rest, 5 s with lips pressed, one warm-up answer
  • 1:26 The conversation: the fixed 2-second timer on the left (shadow only), Hold the Floor on the right (drives the agent), cue lights at the side and a 20-second ribbon of voice, lips, head and breath along the bottom
  • 1:45 A silent pause mid-sentence. The 2-second timer counts down and would have cut in; Hold the Floor shows Holding — lips set
  • 2:02 A 3-second word search, held again
  • 2:17 The camera covered: cues pause, plain 2-second timer, then back
  • 2:30 Esc turns the camera and microphone off; 2:36 the results

Live demo, answer 2: the fixed 2-second timer counts down while Hold the Floor holds on lips set
Live, answer 2: the 2-second timer counts down ("Silence... 1.5 s left") while Hold the Floor holds, because the lips are set for the next word.

Live demo, answer 3: the 2-second timer would have cut in; Hold the Floor is still holding
Live, answer 3: the 2-second timer would have cut in here. Hold the Floor keeps holding until the speaker goes on.

Narrated walkthrough (3:03). The same session, replayed from its saved numbers through the same engine, with each moment explained:

No camera or key? The web replay and npm run start:replay both play that session.

Code

GitHub logo hassan-2050 / hold-the-floor

Voice AI that can see you are not finished yet: camera-aware turn-taking for voice agents, built with the Presage SmartSpectra SDK (Electron)

Runs on Windows x64, macOS on Apple Silicon, or Linux x64/ARM64 (the platforms the SmartSpectra Node SDK supports), with Node.js 20 or newer:

git clone https://github.com/hassan-2050/hold-the-floor.git
cd hold-the-floor
npm install
npm run start:replay   # no camera, no API key: replays the demo session
npm start              # live: webcam, microphone and a Presage API key
⚡ Match Highlights: hassan shah eaebc/hold the floor a voice agent that can see youre not finished yet f - Pertandingan Hari Ini ⚡ Match Highlights: hassan shah eaebc/hold the floor a voice agent that can see youre not finished yet f - Pertandingan Hari Ini

There is no login. Live mode needs a Presage API key, pasted in Setup and stored encrypted by your operating system; the replay needs nothing. Tests: npm test (100 unit tests) and npm run test:e2e (10 end-to-end tests, no camera needed).

How It Responds to Human Signals

Signals. Hold the Floor asks SmartSpectra (@smartspectra/node-sdk 3.5.0) for five metrics: chest breathing, abdomen breathing, breathing rate, face landmarks and talking. Nothing else: no pulse, HRV, expressions or EDA. Telemetry is off.

The four cues: lips pressed or set (face landmarks), still talking (talking signal and mouth movement), breathing in (chest breathing trace), head turned away (face landmarks)

Cue SmartSpectra signal When it holds the floor
Lips pressed Face landmarks 0/17 (outer lips), scaled by eye distance Below a line 35% of the way from your calibrated press up to your rest shape
Lips set Face landmarks 13/14 (inner lips) Parted beyond your rest and held still for 250 ms
Still talking Mouth movement from the landmarks, plus TALKING Mouth moved within the last 100–300 ms
Breathing in Chest breathing trace Rising faster than 0.35 resting breaths per second, and only once the SDK marks breathing stable; alone it holds at most 1.5 s
Head turned Landmarks (nose tip against the eye corners) More than 15° from your forward pose for 300 ms; alone it holds at most 2.5 s

The breathing rate's confidence shows as Breath: warming up until breathing tracking has settled.

In real time. Microphone loudness (one number per 20 ms, against your calibrated noise floor) finds the silences. After 400 ms of silence, any cue that stays on for 120 ms holds the floor. Once every cue has been off for 300 ms, the turn ends and the agent replies. 8 seconds is the hard cap. A short calibration (about 45 s) learns your resting face, a firm lip press and your speaking level, because lip shapes at rest differ a lot from person to person.

When the signal can't be trusted. SmartSpectra's validation status (face not visible, chest out of view, more than one face, too dark) and the measured landmark rate drive a quality gate. After 1 s of bad frames (or at once, for a second face), all camera cues pause and the app falls back to the plain 2-second timer, with the SDK's own hint on screen. Cues come back after 1 s of good frames.

Live demo with the camera covered: "Camera cues paused, using 2.0 s timer", and every cue shows not visible
Live, camera covered: the cues pause, the SDK's hint is shown, and a plain 2-second timer takes over until the face is back.

SDK integration in Electron. bindSmartSpectraIpc runs in the main process, the SDK preload runs in a sandboxed preload script, and the renderer's SmartSpectraSDK is fed the app's own camera stream (useMediaStream). decodeMetrics turns metric packets into numbers. The readiness check in Setup uses checkDeviceReadiness in the main process. I checked every API against the installed typings before using it. docs/SDK-NOTES.md records where the typings and the docs differ, and what a probe on real hardware showed: landmark order, 30–60 ms delivery delay, which way the chest trace moves on an inhale, and that the chest must be in view for any face landmarks to arrive.

What I measured

The live demo session, replayed through the same engine (a unit test checks that the replay reproduces every decision the live run made):

Policy Would-be cut-offs Median reply delay
Hold the Floor 0 1.00 s
0.7 s timer 2 0.70 s
2.0 s timer 2 2.00 s
3.0 s timer 1 3.00 s
4.0 s timer 0 4.00 s

Results screen from the replay: Hold the Floor 0 would-be cut-offs at a 1.00 s median; the fixed timers 2, 2, 1 and 0

Only the 4-second timer also avoided cutting in, at four times the wait. This is one person with scripted pauses, and it isn't perfect: across three recorded takes (24 answers), the shipped settings still ended an answer early 3 times. The next step is a 30-answer self-test in which I press a key only when I'm truly done, as ground truth.

The results screen in the live demo shows the 0.7 s timer with 1 cut-off, not 2. Building the replay turned up a counting bug in the live scorer: a resume 2.46 s after that timer fired arrived from the microphone just after the scorer had stopped looking. It's fixed, along with three replay timing issues; the details are in docs/RESULTS.md.

Prize Categories

Best Thoughtful Real-World Use. Voice agents are moving into customer service, tutoring, interview practice and accessibility tools, and nearly all of them still end your turn on a silence timer. That hurts most the people who pause mid-sentence: second-language speakers, people who stutter, older adults, anyone who thinks aloud. Hold the Floor keeps the fast reply for everyone else, because it waits only while your face says you are mid-turn. It is also upfront about its limits. When it can't see you, it uses a quality gate and a plain timer instead of guessing. Every session is scored against fixed timers on the same input. It is private by default. And the end_of_turn WebSocket API lets any voice agent use it.

Consent and Data Handling

  • Consent first. Nothing starts before the consent screen. Camera and microphone are separate opt-ins, and the operating system asks again the first time each is used. The screen says what is measured (lip shape, head direction, breathing movement, whether you appear to be talking, microphone loudness) and what is not (identity, emotion, health, words). Declining the microphone still works: the camera cues decide, and you press Send. Declining both leaves a Send-only conversation.
  • Easy to stop. Esc or F8 turns the camera and microphone off at any time, within 1 s (0.73 s in the demo), as do the Stop button and closing the window. A Camera on / Mic on indicator shows whenever either is live.
  • Only you. If SmartSpectra reports more than one face, camera cues pause at once.
  • Processing. Camera frames are processed on your computer by the SmartSpectra SDK; the app never saves or sends them. The microphone is reduced to one loudness number per 20 ms; audio is never recorded. The optional mic check in Setup holds 3 s in memory for one playback, then discards it.
  • Storage and retention. Nothing is saved unless you press Save numbers. A saved session is numbers only: 26 face points, the breathing trace, loudness, events, question texts and key presses. It never contains video, audio, the full face mesh, device names or your key. Unsaved sessions vanish when you close the app; saved ones stay in the app's data folder until you delete them.
  • Deletion. Delete one session or all of them from the Results or Privacy screen, and remove the API key in Setup. The Privacy sheet shows the folder.
  • Sharing and network. The app shares nothing and makes no network requests of its own. SmartSpectra telemetry is off (enableTelemetry: false) and requestInsight is never called. The SDK itself still authenticates and checks usage with Presage online while measuring; it has no offline mode.
  • No AI services. No LLM or cloud AI is used. The questions are fixed lists, read aloud by the operating system's built-in voice.
  • The web replay page never asks for the camera or microphone and contains no SmartSpectra code. It loads only its own files and the recorded numbers, and anything you save there stays in the tab's memory.
  • API key. Encrypted with the OS keychain (Electron safeStorage), never logged, and never put in renderer storage.
  • Claims. No diagnosis, treatment, emotion or health claims. The app only decides when the agent may reply.

Full detail: docs/PRIVACY.md.

Agent Session

I built Hold the Floor with Claude Code as a pair programmer, from the plan and the SDK probe through the app, the tests and the walkthrough video.

Top comments (0)