An ultra-low latency desktop audio player and DJ automix workstation featuring embedded C++ DSP signal analysis, harmonic Camelot key detection, dynamic tempo ramping, phase-vocoded time stretching, and real-time WebGL fluid visualizers.
Key Features • Architecture • DSP Mathematics • Tech Stack • Quick Start • Project Structure • License
0xPlay (0xSoundPlayer) is a desktop audio player and harmonic mixing engine written in Go, C++11, and React/TypeScript using the Wails v2 framework. Engineered for audiophiles, DJs, and music enthusiasts, it merges low-level digital signal processing with a fluid glassmorphic user interface.
Unlike traditional media players that rely on external system codecs, 0xPlay embeds lightweight C/C++ audio decoders directly into the binary, delivering instantaneous track decoding, sub-millisecond seek times, background BPM/key detection, and automated harmonic crossfades between tracks.
- ⚡ Zero External Codec Dependencies
- Powered by header-only
miniaudio.hwith embedded static decoders forMP3(dr_mp3),WAV(dr_wav), andFLAC(dr_flac). Zero external.dllfiles, codecs, or runtime installations required.
- Powered by header-only
- 🔬 Real-Time DSP Signal Analysis Engine
- RMS Waveform Peak Extraction: Computes sample-block root-mean-square values to render interactive, high-framerate waveform timelines.
- Autocorrelation BPM Detection: Downsamples 30-second audio envelopes to 200 Hz and applies autocorrelation to detect tempo within 60–180 BPM.
-
Harmonic Key Detection (Camelot Wheel): Processes audio with Hanning windowed 2048-point FFT, projects frequency bins onto a 12-dimensional pitch-class chroma vector, correlates with Krumhansl-Schmuckler tonal profiles, and outputs standard Camelot keys (e.g.,
8A- A minor,8B- C major).
- 🎛️ Intelligent DJ Automix Transition Engine
- Beat-Aligned Quantization: Automatically calculates transition start points aligned to full musical measures.
- Dynamic Continuous BPM Sync: Seamlessly ramps playback speed of outgoing and incoming tracks on-the-fly inside the audio callback without phase discontinuity.
-
Harmonic Pitch Matching: Utilizes the high-quality Signalsmith Stretch phase vocoder to shift incoming track pitch (
$\pm 2$ semitones) to the nearest compatible Camelot harmonic key without altering tempo. - Equal-Power Trigonometric Crossfader: Non-linear trigonometric fade curves maintain consistent acoustic energy throughout transitions.
- 🌊 Hardware-Accelerated WebGL Liquid Wave Visualizer
- GPU-rendered fluid shader reacting in real-time to multi-band audio frequencies (sub-bass, mid, presence, air).
- 📁 Asynchronous Library Indexing & Cache Management
- Multi-threaded non-blocking directory scanning (
~/.0xplayer) with fast ID3 tag extraction and persistent JSON caching (cache.json).
- Multi-threaded non-blocking directory scanning (
┌──────────────────────────────────────────────────────────────────┐
│ 0xPlay React / TypeScript UI │
│ (Glassmorphic Controls + WebGL Fluid Visualizer + Canvas) │
└─────────────────────────────────┬────────────────────────────────┘
│ Wails v2 IPC Bridge / Events
┌─────────────────────────────────▼────────────────────────────────┐
│ Go Backend Core │
│ (App Lifecycle + Library Scanner + Mutex Guards + Cache Sync) │
└─────────────────────────────────┬────────────────────────────────┘
│ Cgo Low-Latency Boundary
┌─────────────────────────────────▼────────────────────────────────┐
│ C++11 Real-Time Audio Engine │
│ │
│ ┌────────────────────────┐ ┌────────────────────────────────┐ │
│ │ miniaudio I/O Core │ │ Signalsmith Stretch Vocoder │ │
│ │ (dr_mp3, dr_wav, flac) │ │ (Pitch Shift & Time Stretch) │ │
│ └────────────────────────┘ └────────────────────────────────┘ │
│ ┌────────────────────────┐ ┌────────────────────────────────┐ │
│ │ DSP Analysis Pipeline │ │ Dynamic Automix Controller │ │
│ │ (FFT, Chroma, Key, BPM)│ │ (Equal-Power Fade & BPM Sync) │ │
│ └────────────────────────┘ └────────────────────────────────┘ │
└─────────────────────────────────┬────────────────────────────────┘
│ OS Native Audio Output
┌─────────────────────────────────▼────────────────────────────────┐
│ WASAPI (Windows) / CoreAudio (macOS) / ALSA (Linux) │
└──────────────────────────────────────────────────────────────────┘
To prevent acoustic volume drops in the center of the mix, non-linear trigonometric curves are applied:
Crossfade duration (
Tempo ratio is continuously recalculated per audio buffer frame:
| Component | Technology | Description |
|---|---|---|
| Backend & IPC | Go 1.23, Wails v2 | Native desktop lifecycle, thread synchronization, and IPC binding |
| Audio Core | C++11, Cgo | Real-time audio rendering, buffer management, and multi-channel mix |
| I/O & Decoders | miniaudio.h |
Multi-platform low-level audio driver and static decoders |
| Phase Vocoder | Signalsmith Stretch |
High-fidelity spectral time-stretching and formant-clean pitch shifting |
| Frontend UI | React 18, TypeScript | Reactive library table, audio effects rack, and playback HUD |
| Visual Effects | WebGL, GLSL Shaders | GPU fluid dynamics audio visualizer with frequency response |
| Audio Metadata | dhowden/tag |
Fast ID3v1/ID3v2, Vorbis, and FLAC metadata tag extraction |
- Go:
v1.21or higher - Node.js:
v18.0.0or higher - C++ Compiler:
- Windows: MinGW-w64 (
mingw-w64-x86_64-gccvia MSYS2) - macOS: Xcode Command Line Tools (
xcode-select --install) - Linux:
build-essentialandlibasound2-dev
- Windows: MinGW-w64 (
- Wails CLI:
go install github.com/wailsapp/wails/v2/cmd/wails@latest
git clone https://github.com/T58574/0xPlay.git
cd 0xPlayStarts the Go backend watcher and Vite HMR dev server:
wails devCompiles optimized, zero-dependency native executable for Windows:
wails build -platform windows/amd64Output executable will be generated at: build/bin/SoundPlayer.exe.
0xPlay/
├── .github/
│ └── workflows/
│ └── release.yml # Automated CI/CD Cgo compilation pipeline
├── backend/ # Go & C++ Core Engine
│ ├── audio_engine.cpp # Real-time C++ audio mixing, DSP & Automix logic
│ ├── audio_engine.h # C interface headers for Cgo
│ ├── audio_engine.go # Go wrapper and memory management
│ ├── app.go # Wails API bindings and library management
│ ├── miniaudio.h # Low-level audio device abstraction and decoders
│ └── signalsmith-stretch.h# Phase vocoder time-stretching and pitch-shifting
├── frontend/ # React / TypeScript Application
│ ├── src/
│ │ ├── components/ # UI Components (PlaybackBar, LibraryTable, AudioEffects)
│ │ ├── features/ # WebGL Fluid Wave Visualizer shaders & container
│ │ ├── App.tsx # Main application orchestrator
│ │ └── App.css # Glassmorphic styling and design tokens
│ ├── index.html # Web viewport entry point
│ ├── package.json # Frontend package manifest
│ └── vite.config.ts # Vite bundler configuration
├── main.go # Wails application bootstrap
├── go.mod # Go module dependencies
├── wails.json # Wails desktop configuration
├── LICENSE # MIT License
└── README.md # Project documentation
This project is licensed under the MIT License. See the LICENSE file for details.