Skip to content

Lemelson/VoiceScope

Repository files navigation

VoiceScope

A local, in-browser voice pitch analyzer. Records your voice from the microphone, detects the fundamental pitch with the YIN algorithm and shows which notes your voice hit, second by second.

Open the app: lemelson.github.io/VoiceScope

All analysis runs locally in your browser. Audio is never uploaded to GitHub or any other server.

Features

  • Unlimited recording length with manual stop (button or Space).
  • Pitch contour over time as a piano roll: notes vertically, seconds horizontally.
  • Live view while recording: real-time pitch chart, current note/Hz, and a running median.
  • MA and EMA smoothing lines — see how the voice moved up and down.
  • Outlier trimming: a median filter removes single-frame octave spikes; percentile trimming cuts hiss (too high) and random dips (too low); a hybrid MAD mode targets short glitches only.
  • Neutral statistics (median, mean, range, spread) instead of labels.
  • Reading passages (content.js) in English or Russian — pick the language before recording, shuffle with "Another text". Each passage is ~1–1.5 minutes read aloud.
  • Playback with a chart playhead, WAV download, and a local recording history.
  • Light/dark theme, remembered between visits.

Running locally

The microphone needs a secure context (https, localhost, or file://).

Option 1 — double click. Open index.html in Chrome or Firefox (file:// usually works).

Option 2 — local server (most reliable, recommended for Safari):

cd VoiceCellCopy
python3 -m http.server 8000

Then open http://localhost:8000 and allow microphone access.

Controls

  • Start recording / Stop — buttons or the Space key.
  • No auto-stop timer: the recording runs until you stop it.
  • Under the chart, "Analysis settings" holds the processing profile, display toggles (points/EMA/MA), trimming mode, and fine-tuning sliders — all re-render instantly without re-recording.

Playback

  • Chart playhead: a vertical line follows the contour during playback.
  • Chart controls: click the chart to play from that point; click near the line to pause; hover shows the time. The audio player below works too.
  • History playback: play any saved recording right from the list (▶) or delete it (✕).

Processing profiles and fine-tuning

Quick profiles above the chart: Raw · Gentle · Smart (default) · Strict · Maximum. Each sets sensitivity, MA window, EMA span and trimming mode at once. Smart uses the hybrid MAD trimmer, which removes short glitches by local context instead of blindly cutting percentiles. Any manual tweak in Analysis settings switches to a Custom profile.

  • Outlier trimming: Off / Light 1% / Medium 3% / Strict 5% / Aggressive 10% / Smart (hybrid MAD — compares each frame against neighbouring speech and additionally catches short global extremes near pauses; sustained pitch changes are preserved).
  • Sensitivity — confidence threshold of the pitch detector (lower = catches more quiet/noisy material; higher = only clear tone).
  • MA window — width of the centred moving average.
  • EMA span — responsiveness of the exponential line.
  • Octave correction — fixes short 2× errors when the detector confuses the octave. It compares against unchanged neighbouring frames on both sides, so a noisy burst can't drag subsequent normal speech to the wrong octave.
  • Min duration — drops very short bursts (clicks, artifacts).
  • Adaptive silence floor — estimates background noise and cuts anything quieter.

F0 reference

The results include a descriptive speaking-F0 zone and percentile estimates based on a simple statistical model: men 116±16 Hz, women 190±25 Hz. Note that "100 Hz is lower than ~84% of men" means only about 16% sit at 100 Hz or below. These are statistical references, not a diagnosis. Sources: Awan et al. 2017, Hudson & Holbrook 1981, Fernández Liesa et al. 1999, Barsties 2013.

Parallel recording protection

The app takes a browser navigator.locks lock named voicescope-recording. If a recording is already running in another VoiceScope tab, a new tab shows a warning instead of grabbing the microphone a second time. Browsers without Web Locks still get single-tab double-start protection.

Recording history (local)

The last 30 recordings are stored in the browser (IndexedDB), up to 1 GB total — older ones are pruned automatically. Each can be reopened (same contour), played, downloaded as WAV, or deleted. Stored per recording: WAV, pitch contour (f0/confidence/loudness per frame), median, and the settings used.

Planned: trim calibration from collected recordings

The Export JSON button downloads voicescope-data.json with all pitch contours (no audio, compact). Future task (on request): analyze the accumulated ~30 recordings to check whether edge trimming is too aggressive or too weak — i.e. whether real low/high voice segments are being discarded instead of random artifacts — and adjust the default presets/percentiles accordingly.

How it works

  1. PCM capture from the microphone (no noise suppression/AGC, to avoid distorting the pitch).
  2. Decimation to ~16 kHz, frame-by-frame YIN (~33 ms window, 8 ms hop) → frequency + confidence.
  3. Filtering: confidence threshold, 55–600 Hz range, median filter, local octave correction, min-run, then percentile or local-MAD trimming.
  4. Hz → notes (MIDI), MA/EMA in semitone space, canvas rendering.

Tests

node --test tests/analysis-core.test.js

About

Free online voice pitch analyzer — see your fundamental frequency (F0) in Hz, musical notes, and pitch over time. Private, runs locally in your browser. A clean voicecel alternative.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors