Real-time speech visualization toolkit with four specialized modes for acoustic analysis. Features a user-friendly GUI launcher, configurable analysis parameters, and automated data export for research, clinical, and pedagogical applications.
For a detailed description of the VocalTrack architecture and signal processing pipeline, please refer to the methods article, currently under review, or check out the comprehensive documentation available in the wiki.
- Four Visualization Modes:
- LiveVowel: Real-time vowel space tracking (F1/F2 formant display)
- LivePitch: Fundamental frequency (f0) contour visualization
- LiveSpectrogram: Scrolling wideband spectrogram
- LiveSpectrum: Real-time FFT spectrum analyzer
- GUI Launcher: PySide6 interface with comprehensive settings dialogs
- Advanced Smoothing: 1-Euro filter for responsive yet stable tracking
- Flexible Analysis: Native or Parselmouth backend for formant/pitch extraction
- Automated Export: WAV audio + CSV data logs for vowel and pitch modes
- Benchmarking Tools: Built-in accuracy and timing benchmarks
- Audio Capture:
AudioProcessorcontinuously reads microphone input in small chunks via PyAudio - Windowing: Chunks are combined to form analysis windows (configurable duration)
- Acoustic Analysis:
Soundobjects compute formants, pitch, or spectra depending on mode - Smoothing: Adaptive
Smoothermaintains a memory applies 1-Euro filtering for stable trajectories - Visualization: Real-time Pygame rendering with configurable scales and ranges
- Export: Automatic WAV + CSV export on exit (LiveVowel and LivePitch modes)
- Python 3.7 or higher
- Microphone/audio input device (head-mounted microphones are require for proper function)
- OS audio permissions enabled
- Clone the repository:
git clone https://github.com/santiagobarreda/VocalTrack.git
cd VocalTrackOr download from GitHub and unzip into local directory.
- Install dependencies:
pip install -r requirements.txt- Launch the GUI:
python vocaltrack.pyConfigure parameters before launching a mode:
- Analysis Settings: Window duration, formant/pitch bounds, analysis method
- Smoother Settings: 1-Euro filter parameters, memory, stability thresholds
- Recording Settings: Select audio input device, and whether to save audio
- Formant Plot Settings: F1/F2 ranges, display mode, frequency scale
- Pitch Plot Settings: f0 display range, plot mode (fixed/continuous)
- Spectrogram Settings: Frequency range, colormap, dynamic range, padding
- Spectrum Settings: FFT parameters, display range, smoothing
Click one of the four launch buttons:
- LiveVowel (green): Vowel space tracking with F1/F2 display
- LivePitch (blue): Pitch contour visualization
- LiveSpectrogram (purple): Scrolling spectrogram
- LiveSpectrum (orange): Real-time spectrum analyzer
Common (all modes where implemented):
ESC: Quit and save (if applicable)G: Toggle grid overlayH: Toggle help overlay+/-: Adjust threshold/gain/dynamic range
LiveVowel:
Ctrl+V: Toggle recording stateCtrl+T: Toggle vowel template displayL: Toggle log/linear frequency scaleBackspace: Undo last track (in track mode)Delete: Clear all tracks (in track mode)
LivePitch:
Space: Push-to-talk recording (hold to record)Backspace: Remove last trackDelete: Clear all tracks
LiveSpectrogram:
Ctrl +/Ctrl -: Adjust gain
LiveSpectrum:
+/-: Adjust gain offset
Files are automatically saved to recordings/ on exit:
LiveVowel:
speaker_YYYY-MM-DD_HHMMSS.wav: Audio recordingspeaker_YYYY-MM-DD_HHMMSS_formants.csv: Timestamped F1/F2/F3 data (voiced frames only)
LivePitch:
speaker_YYYY-MM-DD_HHMMSS_pitch.wav: Audio recordingspeaker_YYYY-MM-DD_HHMMSS_pitch.csv: Timestamped f0 data (voiced frames only)
Note: LiveSpectrogram and LiveSpectrum are visualization-only modes and do not export CSV files by default.
Core Components:
AudioProcessor: Background thread for real-time audio captureSound: Acoustic analysis engine (formants, pitch, spectrum)Smoother: Adaptive 1-Euro filter for trajectory smoothingBaseAudioVisualizer: Shared pygame rendering and event handlingLiveVowel,LivePitch,LiveSpectrogram,LiveSpectrum: Mode-specific visualizers
Configuration:
config.py: Default parameters for all modes.VocalTrack_settings.json: Persistent user settings (auto-saved)
Run accuracy and timing benchmarks from the launcher:
- Click Benchmarking button
- Select benchmark comparison (Parselmouth vs. 'native' or 'custom')
- Follow on-screen recording instructions
- Results saved to
benchmarking/folder
No audio input:
- Open Recording Settings and verify input device
- Check OS microphone permissions
- Test:
python -c "import pyaudio; print(pyaudio.PyAudio().get_device_count())"
Poor tracking quality:
- Adjust min/max f0 for your voice in Analysis Settings
- Increase
min_rms_db(less negative) to ignore background noise - Tune smoother parameters for your use case
- Use a quieter environment and speak closer to microphone
- Use a good microphone! Any USB headmounted microphone is probably good enough. Miscrophones on laptop screens or on webcams may result is very poor performance.
GUI launcher issues:
- Verify PySide6:
pip install PySide6>=6.5.0 - Check
.VocalTrack_settings.jsonfor corruption
Formant/pitch extraction errors:
- Switch between
nativeandparselmouthmethods in Analysis Settings - Install Parselmouth if needed:
pip install praat-parselmouth
TBD
See LICENSE file for details.
