A low-latency C++ music engine with real-time DSP effects, FFT spectrum analysis, YouTube integration, and a REST API. All built from scratch with raw pointers, manual memory management, and zero external libraries.
See demo of the engine features served via the REST API, showcased on a simple testUI.html file (UNMUTE video below!).
vibeify-demo.mp4
Five chainable audio effects processed in real-time on the PCM buffer:
| Effect | Command | Range | Description |
|---|---|---|---|
| Echo | echo <0-100> |
Delay-based echo with feedback | Configurable delay line |
| Reverb | reverb <0-100> |
Multi-tap room simulation | Simulates acoustic space |
| Bass Boost | bass <0-100> |
Low-frequency amplification | Single-pole IIR filter |
| Distortion | distort <0-100> |
Hard/soft clipping | Waveshaper with tanh curve |
| Speed | speed <25-400> |
Playback speed (%) | Linear interpolation resampler |
Effects are applied in a dynamic chain: Source β Speed β Bass β Echo β Reverb β Distortion β Volume
- Cooley-Tukey radix-2 FFT (1024-point)
- Hann window to reduce spectral leakage
- 64 frequency bands with logarithmic distribution
- Real-time analysis on every audio buffer
- ASCII visualizer in CLI, JSON array via API
Search and play music from YouTube directly:
- Powered by
yt-dlp+ffmpeg(auto-detected at startup) - Downloads as 44.1kHz stereo 16-bit WAV
- File caching in
media/cache/(skips re-download) - Auto-saves to
media/samples/for persistent library
Raw Winsock2 HTTP server on localhost:8080, running alongside the CLI on a separate thread. Full CORS support for browser frontends.
| Endpoint | Description |
|---|---|
/api/tracks |
List all loaded tracks |
/api/now |
Current playback status |
/api/spectrum |
64-band frequency data (JSON array) |
/api/effects |
Current effect levels |
| Endpoint | Body | Description |
|---|---|---|
/api/play |
{"id": 1} |
Play track by ID |
/api/pause |
β | Pause playback |
/api/resume |
β | Resume playback |
/api/stop |
β | Stop playback |
/api/volume |
{"level": 75} |
Set volume (0-100) |
/api/effects |
{"bass": 50, "echo": 30} |
Set effect levels |
/api/effects |
{"clear": "true"} |
Reset all effects |
/api/yt/search |
{"query": "song name"} |
Search YouTube |
/api/yt/play |
{"index": 1} |
Play from search results |
/api/search |
{"query": "artist"} |
Search local library |
ββββββββββββββββββββββββββββββββββββββββββββββββ
β main.cc β
β CLI (PlaybackController) + HTTP Server β
βββββββββββββββββ¬βββββββββββββββββββββββββββββββ€
β Terminal β REST API (port 8080) β
β Commands β ApiController β
βββββββββββββββββ΄βββββββββββββββββββββββββββββββ€
β AudioEngine β
β βββββββββββββββββββββββββββββββββββββββββββ β
β β Effect Chain (dynamic rebuild) β β
β β Source β Speed β Bass β Echo β β β
β β Reverb β Distortion β Volume β β
β βββββββββββββββββββββββββββββββββββββββββββ€ β
β β SpectrumAnalyzer (FFT on each buffer) β β
β βββββββββββββββββββββββββββββββββββββββββββ€ β
β β Windows WaveOut (double-buffered PCM) β β
β βββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββ€
β TrackLibrary β WAV files (media/samples/) β
β YouTubeSource β yt-dlp (media/cache/) β
β StreamCache β persistent download manager β
ββββββββββββββββββββββββββββββββββββββββββββββββ
Requirements: MinGW g++ (C++17), Windows
mingw32-make clean
mingw32-makeOptional (for YouTube):
winget install yt-dlp
winget install ffmpeg.\vibeify.exeThe engine starts both the CLI and the API server on port 8080.
Playback: play <id>, pause, resume, stop, skip, prev
Queue: queue <id>, list, now, search <query>
Effects: echo <0-100>, reverb <0-100>, bass <0-100>
distort <0-100>, speed <25-400>
effects, clear, spectrum
YouTube: yt-search <query>, yt-play <1-5>
General: help, quit
# List tracks
curl http://localhost:8080/api/tracks
# Play track 1
curl -X POST http://localhost:8080/api/play -d "{\"id\": 1}"
# Bass boost + echo
curl -X POST http://localhost:8080/api/effects -d "{\"bass\": 60, \"echo\": 40}"
# Get spectrum data
curl http://localhost:8080/api/spectrum
# Search YouTube
curl -X POST http://localhost:8080/api/yt/search -d "{\"query\": \"lofi beats\"}"
# Play first result
curl -X POST http://localhost:8080/api/yt/play -d "{\"index\": 1}"βββ main.cc Entry point, starts CLI + API server
βββ AudioEngine.h/.cc Core audio renderer (WaveOut, effect chain, FFT)
βββ AudioNode.h Base class for all audio sources
βββ AudioEffect.h/.cc DSP effects (Echo, Reverb, Bass, Distortion, Speed)
βββ AudioBuffer.h Float PCM buffer with clamping
βββ SpectrumAnalyzer.h/.cc Cooley-Tukey FFT, Hann window, frequency bands
βββ Track.h/.cc WAV file loader and PCM source
βββ Playlist.h/.cc Double-linked-list track queue
βββ TrackLibrary.h/.cc Raw pointer array track collection
βββ PlaybackController.h/.cc Terminal CLI interface
βββ HttpServer.h/.cc Raw Winsock2 HTTP server (threaded)
βββ ApiController.h/.cc REST endpoint router with JSON I/O
βββ YouTubeSource.h/.cc yt-dlp wrapper (search + WAV download)
βββ StreamCache.h/.cc Download cache manager
βββ WavGenerator.h Procedural waveform generator (sine, square, saw)
βββ Makefile MinGW build system
βββ media/
βββ samples/ Persistent WAV library (auto-loaded on startup)
βββ cache/ YouTube download cache
- Zero external libraries - raw Win32 API (WaveOut, Winsock2), manual everything
- Raw pointer memory management -
new/delete, no smart pointers, no STL containers for core data - Double-buffered audio - callback-driven WaveOut with two alternating PCM buffers
- Dynamic effect chain - rebuilds on parameter change, only active effects are processed
- In-place FFT - Cooley-Tukey butterfly with bit-reversal permutation
- Hand-rolled HTTP - raw TCP socket, manual HTTP parsing, JSON building
- Dual interface - CLI and REST API control the same engine instance simultaneously