A real-time audio spectrogram visualizer built with Svelte 5, Bun, Typescript, WebGL2, and the Web Audio API.
This application provides a live analysis and visualization of your microphone input with some advanced features for musicians, voice coaches and audio enthusiasts.
Inspired by Friture: A real-time audio analyzer and Praat: Doing Phonetics by Computer.
-
Real-time Audio Analysis: Standard FFT-based frequency analysis
-
Multiple Visualization Modes:
- Linear, Logarithmic, and Mel frequency scales
- Customizable frequency range (20Hz - 20kHz)
- Adjustable FFT size and smoothing
- Grayscale, Inferno, and Magma color maps
-
Musical Features:
- Note detection and pitch tracking
- Musical note guidelines and frequency markers
- Interactive pitch feedback with cents deviation
- Reference tone generator with adjustable volume
-
Advanced Settings:
- Automatic pitch following
- Customizable tick markers
- Adjustable scroll speed
- Multiple interpolation modes
-
Mobile Friendly
- Allow microphone access when prompted by your browser
- Click anywhere on the page to start the audio analysis
- Use the settings panel on the left to customize the visualization:
- Adjust frequency range
- Increase the FFT resolution
- Try to hit certain notes with the help of the note guidelines
Space
: Pause/Resume the visualizationT
: Cycle through tick variantsC
: Switch color mapsG
: Toggle note guidelinesF
: Toggle pitch following
- Svelte 5: UI framework and tool for building web applications
- Bun: Fast JavaScript all-in-one toolkit
- WebGL2: Performant graphics rendering
- Web Audio API: Real-time audio processing
- TypeScript: Type-safe JavaScript alternative
- Simple loudest frequency detection
- Fundamental frequency estimation (Custom variant of the Harmonic Product Spectrum)
- Pitchy, implementing "A Smarter Way to Find Pitch" by Philip McLeod and Geoff Wyvill
- Clone the repository:
git clone https://github.com/Paul1365972/spectrogram.git
cd spectrogram
- Install dependencies:
bun install
- Start the development server:
bun dev
To create a production build:
bun run build
The built files will be in the ./dist/
directory.
You can also preview the production build using:
bun preview