This is a submission for the Presage Challenge
What I Built
I sit in front of my laptop for many hours every day. I never know when to get up or when to take a break. And I only notice I'm stressed or tired when it's already too late (hello back pain >_<).
So I built Ovra. It reads your heart rate through your camera to guess your mood. Then it changes your Spotify music to match, and tells you when to stretch or take a walk.
It's for anyone who works long hours at a laptop. Students, developers, designers, LITERALLY anyone who forgets their body exists until 2 AM :)
Demo
Tip: click the chapters in the video description to jump to each mood.
Real moods take minutes to show up. Want to try it out fast? Turn on the built-in Demo mode: a 10-minute tour that shows everything Ovra can do. That's what the video uses.
There are 3 ways to run Ovra:
| Mode | What it's for |
|---|---|
| Normal session | The real thing. Best for 45+ minutes |
| Demo mode | A 10-minute tour of every mood, music change and exercise |
| Simulator | A dev tool that fakes every mood on demand (npm run dev:simulate) |
Code
surrelsaga
/
ovra
a desktop app that reads your heart rate through camera to guess your mood, then plays Spotify music to match
Ovra
Ovra reads your heart rate and breathing through your camera, then changes your Spotify music to fit how you feel. It also reminds you to stretch or take a walk when you've sat too long
Tech stack
- Electron: runs Ovra as a desktop app on Mac and Windows
- TypeScript + React: the app's code and screens
- Vite (electron-vite): builds and runs the app while developing
- Presage SmartSpectra SDK: reads heart rate, breathing and face from the camera
- Spotify desktop app: plays your music; Ovra controls it (AppleScript on Mac, PowerShell on Windows)
- Last.fm: song tags, to know if a song is calm or upbeat
- OpenRouter: AI guess of a song's mood when Last.fm isn't enough
- Vitest: tests
- electron-builder: makes the .dmg and .exe files
Get Ovra
Recommended: download the app
The downloaded app has everything set up, no keys needed…
-
Download:
.dmg(Mac) and.exe(Windows) on Releases -
Or run it yourself: clone, add your keys to
.env, thennpm run dev. Setup is in the README.
How It Responds to Human Signals
The signals
| Signal | What it does in Ovra |
|---|---|
| Heart rate | The main one. It decides the mood |
| HRV (time between beats) | Backup. Can confirm or cancel Stressed |
| Breathing | Can only make Ovra more sure of Stressed. Never decides |
| Face (smiling, looking upset, blinking, head tilt) | Only if you say yes. Supports a mood, never makes one alone. Also checks you really did the neck stretch |
| Status codes | Tell Ovra if you're there, away, moving, or if someone else is in view |
The rules
First, Ovra reads your heart rate for 30 seconds while you sit normally. That's your baseline: what's normal for you right now. Every rule below compares your heart rate with it.
Example: baseline 70 bpm → Stressed from about 81 bpm, Tired at about 64 bpm or lower.
| Mood | Rule (compared with your baseline) | Music | Exercise |
|---|---|---|---|
| Steady | Heart rate within 8% of it | Your usual mix for what you're doing | — |
| Good mood | Steady + smiling most of the time | Upbeat songs to keep it going | — |
| Stressed | 15% or more above it (10% if HRV agrees), for 3 min | Calmer songs | Breathe along |
| Very stressed | Stressed for 10 min, or 20% above it with an upset face | Fades down to a calm song | A short walk |
| Tired | 8% or more below it, for 2 min | Energetic songs to wake you up | Stand and stretch |
| Away | No face for 20 s | Pauses | — |
The whole loop:
camera → Presage SDK → every 30 s, look at the last minute
→ compare with your baseline → mood must hold for a few minutes
→ change the moon, the music, maybe suggest an exercise
=> One weird reading never changes anything. A mood has to hold first.
How I use the SmartSpectra SDK
- Setup. Face metrics are only requested if you said yes to face reading:
const sdk = new SmartSpectraSDK({
apiKey,
requestedMetrics: [...breathingMetrics, ...cardioMetrics, ...(face ? faceMetrics : [])],
enableTelemetry: false // the SDK's default is true
})
-
My camera, not the default one. I open the camera myself and hand it over with
sdk.useMediaStream(stream). That's how you can pick which camera in Settings (my friend's laptop kept picking his phone camera 😅). - The shrunk picture. The camera is drawn at 80% size inside a 1280×720 frame. That gets past the SDK's "chest not visible" check (code 7) when you slouch. Good signal went from 7–27% of the time to ~75%.
-
Status codes → plain words. Ovra listens to
validationStatusand says what's going on:- code 2 (only one face allowed) → "Another face in view · no change"
- code 12 (too much motion) → "Couldn't see you clearly · no change"
- code 1 (no face) for 20 s → Away, music pauses
-
When the SDK dies. I listen for
errorandprocessingStatus === kError. Ovra restarts the SDK up to 3 times and says "Camera reconnecting", instead of thinking you left. - Frozen camera. I use the SDK's own frame timestamps, not the time a reading arrives. A frozen picture can't fake you being there.
- Camera off between checks. By default the camera looks for about 90 s every 5 minutes, then fully turns off.
You can't fake a mood
I tried. A test clip with a fake angry face changed nothing, because the heart rate didn't go up. The face only supports what your heart says.
In my own 45-minute session: no false Stressed, no false Away. Standing up to stretch came close to "away" (about 13 s without a face) but stayed present.
Bugs that taught me things
app.asar, which can't load native files. => Point the SDK to the unpacked copy before importing it.
Full rules (for the curious)
The science behind the vibes
I didn't want Ovra to guess on vibes alone, so I read up first. Here's what I found, and what it changed.
| What the research says | Source | So Ovra… |
|---|---|---|
| Mental stress raises heart rate (a Stroop task: about +20 bpm) | Crossover study | uses heart rate as the main signal. Stressed = 15%+ above your baseline |
| HRV drops under acute mental stress (12 studies, 758 adults) | Castaldo et al. 2015 | uses HRV to confirm or cancel Stressed |
| Webcam heart rate is off by about 2–3 bpm, worse when you move | Webcam vs ECG study | waits minutes before naming a mood, and pauses when you move |
| About 6 breaths a minute raises HRV the most (84 people) | PubMed 2024 | the breathing moon grows and shrinks at 6 breaths a minute |
| Hold a stretch 10–30 seconds | ACSM 2021 | each stretch step lasts 10–35 s |
| Short breaks (10 min or less) boost energy and lower fatigue (2,335 people) | Albulescu et al. 2022 | suggests short breaks: a 5-min walk, or 10 min outside |
Sitting reminders (counted from when you sat down, reset when you leave for a minute or more): => At most one suggestion every 20 minutes, so it never piles up. Music: the direction changes at most once every 3 minutes. For variety, Ovra switches playlist after 12 songs in Focus/Reading, or 7 in the other activities.Break timing and music
Reminder
Focus / Reading
Creative / Everyday / Unwind
Neck and shoulder stretch
30 min
25 min
Stand and stretch
60 min
50 min
Walk and get water
90 min
75 min
Prize Categories
Most Creative or Delightful Use: your heartbeat picks the music, and a little pixel moon breathes with you when you need to calm down.
Best Thoughtful Real-World Use: for anyone stuck at a desk for hours, Ovra notices stress and tiredness early and gets you moving, with no poses to hold.
Consent and Data Handling
Ovra asks first. The questions come one at a time, with no "accept all":
| Question | Default |
|---|---|
| Can Ovra use your camera during sessions you start? | You must answer |
| Every few minutes, or the whole session? | Every few minutes |
| Read your face too, or heart rate and breathing only? | You must pick |
| Look up songs on Last.fm and use AI to sort them? | No |
| Share anonymous diagnostics with Presage? | Don't share |
| Auto-delete old session history? | 30 days |
Say "Not now" to the camera and Ovra still works: timer, music and break reminders.
The camera only runs in sessions you start. A ring around the moon shows whenever it's on. Ovra never asks for the microphone.
What's stored, and what's not:
| Stored (on your computer) | Never stored |
|---|---|
| Mood labels with times ("Steady at 10:05") | Video, frames or images |
| Moves done or skipped, session length | Heart rate, breathing, HRV |
| Songs played and how they suit you | Face data or expressions |
| Playlist links, settings, privacy answers, which camera you picked | Your baseline (it's dropped when the session ends) |
Everything sits in one folder that only your user account can read: ~/Library/Application Support/Ovra/ on Mac, %APPDATA%\Ovra\ on Windows. The code refuses to save a file that contains a raw reading.
What leaves your computer:
- Presage: your API key check and a usage count, each time the camera starts. Video is processed on your computer.
- Last.fm and OpenRouter (only if you say yes): song titles, artists and public tags. Never your readings or moods.
- Telemetry: off unless you choose "Share".
Deleting: history auto-deletes after 30 days. You can also delete one session, clear the music library, or press Delete everything.
Ovra never saves or uploads your video. It's a wellness app, not a medical device.
Not perfect (yet), and how I'd fix it
- Spotify pops up for a second when Ovra switches playlist. The desktop app only lets other apps skip songs, not pick one quietly. => Connecting to Spotify's Web API would let Ovra pick songs directly, with no pop-up.
- Accuracy needs long sessions. Demo mode is a tour, not a test. => Test with more people over full work days, then tune the numbers.
- The Mac app isn't signed by Apple, so the first launch needs one Terminal command. => An Apple developer account fixes that.
- Breathing is mostly unused, because the shrunk picture hides the chest. => Better framing could bring it back.
- The download carries shared API keys that someone could dig out of the app. OpenRouter is capped at 50 requests a day, so the risk is small. => A small server that holds the keys.
That's Ovra. Try it, take a break, and let your music chill you out
If you like it, a ⭐ on GitHub really help!



Top comments (2)
the 'one weird reading never changes anything' rule is the part i respect. a mood has to hold before it counts.
haha, thanks 😊