This is a submission for the Presage SmartSpectra SDK Challenge
What I Built
Sama (सम · સમ, "balance") is a 5-minute paced breathing rehearsal that uses your webcam to read your pulse and breathing rate live. It has a Hinglish, Hindi and Gujarati UI, because most breathing apps assume English.
The flow: consent, a 30 second baseline, a 5 minute guided breathing session, and a result that compares you with your own baseline. It is general wellness only. It does not diagnose anything or measure "stress".
Demo
Video disclosure: I could not show my own face on camera, so the demo video uses licensed stock test footage (Mixkit, "Man talking in a video conference call", Mixkit Stock Video Free License). I am not the person in the video. The pulse and breathing numbers on screen are computed live by the real Presage SmartSpectra SDK from that footage, and the video carries an on-screen label saying so.
Demo video: https://github.com/Pritahi/sama-presage/releases/download/v1.0-demo/sama-demo.mp4 (about 2 minutes: 30 s baseline, then the breathing rehearsal) The video uses a shortened 60 second rehearsal and is a screen capture of the real run.
Code: https://github.com/Pritahi/sama-presage
How I Used the SmartSpectra SDK
SmartSpectra has no browser SDK, so I use @smartspectra/node-sdk in a small local Node server and a browser page for the UI:
- The page captures webcam frames (with consent) and sends them over a local WebSocket.
- The server calls
useCustomInput()andsendFrame(), and requestscardioMetricsandbreathingMetrics. - Live pulse rate and breathing rate come back through the SDK
metricsevent. - The
validationStatusevent ("No face found", lighting and so on) drives a signal-quality gate. The baseline timer only counts while the signal is good and pauses when it drops. - The result screen compares the rehearsal with the same session's baseline.
Consent and Data Handling
- Camera starts only after you agree and press Start, and stops when you stop or the session ends.
- No video is recorded, stored or uploaded. Frames go to a server on your own machine and are dropped after processing.
- The SDK computes metrics on-device. It contacts Presage only to validate the API key and subscription. SDK telemetry is off by default.
- Only summary numbers and an optional note are saved, in your browser's localStorage. You can export them as JSON or delete them (one session or all) at any time.
- No AI services are used. No accounts.
- Not a medical device. No diagnosis, treatment or stress claims.
What I Learned
The biggest lesson: SmartSpectra has no browser SDK, so I had to build a local Node server with a browser UI on top. I also hit two bugs that broke the live demo: the camera frame rate had to be close to 30fps, and the SDK's pulse confidence is on a 0-100 scale while I assumed 0-1.

