Warning
This project, including 99% of this README, is entirely vibe-coded using LLMs and may not be a 1:1 port of the original Python implementation. Educational purposes, dragons lie beyond, yada yada. I just wanted something faster that works to double the sample rate of various sound files. I barely tested it beyond the core functionality, so use at your own risk.
A high-performance C++ port of HRAudioWizard - an audio enhancement tool that uses high-frequency compensation (HFC) to improve the quality of low-fidelity recordings by synthesizing plausible high-frequency content.
- High-Frequency Compensation: Synthesizes missing high frequencies using harmonic overtone analysis
- Flexible Upsampling: Choose output sample rates from 1x to 16x the input rate
- Real-time Processing: Fast STFT-based processing using KissFFTTo be implemented? - Modern GUI: Built with Dear ImGui for a responsive, cross-platform interface
- Batch Processing: Process multiple audio files with progress tracking
- Drag & Drop: Simply drag audio files into the window
- Multiple Format Support: Supports WAV, FLAC, OGG, and other formats via libsndfile- this is probably a lie it always outputs WAV files I think, TODO fix that
- Install Homebrew if you haven't already:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- Install required dependencies:
brew install cmake libsndfile- Clone the repository:
git clone https://github.com/yourusername/HRAudioWizard_CPP.git
cd HRAudioWizard_CPP- Run the setup script to download KissFFT:
./setup_deps.sh- Build the project:
./build.sh- Run the application:
./run.shDidn't do it
Didn't do this either
- Launch the application
- Click "Add Files" or drag audio files into the window
- Configure settings:
- Enable HFC: Toggle high-frequency compensation
- Lowpass Frequency: Set the frequency above which to synthesize content (might be better to legit just set it to the max idk how this works)
- Sample Rate Multiplier: Choose how much to upsample (2x, 4x, 8x, etc.)
- Compressed Source Mode: Optimize for heavily compressed sources
- Click "Process Files" to enhance your audio
The processed files will be saved in the same directory as the originals with "_enhanced" appended to the filename.
HRAudioWizard uses a sophisticated algorithm to analyze the harmonic structure of existing audio content and extrapolates plausible high-frequency components:
- STFT Analysis: Converts audio to frequency domain using Short-Time Fourier Transform
- Peak Detection: Identifies fundamental frequencies and their harmonics
- Harmonic Synthesis: Generates overtones based on the spectral envelope
- Phase Reconstruction: Uses Griffin-Lim algorithm for coherent phase
- Spectral Smoothing: Applies temporal and frequency smoothing for natural results
- C++17 compatible compiler
- CMake 3.10 or higher
- libsndfile
- OpenGL (usually pre-installed)
# Clone the repository
git clone https://github.com/yourusername/HRAudioWizard_CPP.git
cd HRAudioWizard_CPP
# Download dependencies
./setup_deps.sh
# Build
mkdir build
cd build
cmake ..
make -j4
# Run
cd ..
./build/bin/HRAudioWizard- FFT Size: 4096 samples
- Hop Size: 2048 samples (50% overlap)
- Window: Hann window
- Processing: Mid/Side stereo processing
- GUI Framework: Dear ImGui with GLFW/OpenGL backend
- DSP Library: KissFFT for fast Fourier transforms
- Audio I/O: libsndfile for format support
This project is licensed under the MIT License
- Original Python implementation by @Super-YH
- KissFFT by Mark Borgerding
- Dear ImGui by Omar Cornut
- libsndfile by Erik de Castro Lopo
