An interactive real-time audio visualizer built with C++ and OpenGL. This application provides dynamic visualizations of audio input, supporting both live audio and file playback.
This project combines audio processing and graphics rendering to create an engaging visual representation of audio data. It offers multiple visualization styles and interactive controls for a customizable experience.
- Real-time audio processing and visualization
- Multiple visualization styles: Bar Graph, Circular, and Wave
- Support for both live audio input and audio file playback
- User-friendly interface with adjustable parameters
- Native file dialogs for file selection
- Modular architecture for maintainability and extensibility
- C++ for core application logic
- OpenGL for graphics rendering
- GLFW for window management and OpenGL context creation
- Dear ImGui for the graphical user interface
- PortAudio for real-time audio input/output
- FFTW for Fast Fourier Transform calculations
- libsndfile for audio file reading
- Native File Dialog Extended for cross-platform file dialogs
The application is designed with a modular architecture that separates concerns:
- Application: Main application logic, window management, and event handling
- AudioProcessor: Handles audio input/output, FFT, and audio file playback
- Visualizer: Manages rendering different visualization styles
- UIManager: Handles UI rendering and user input
- VisualizationStyles: Pluggable visualization implementations (Bar Graph, Circular, Wave)
Ensure you have the following installed on your system:
- CMake (version 3.12 or higher)
- C++ compiler with C++17 support
- OpenGL
- GLFW
- GLEW
- PortAudio
- FFTW
- libsndfile
On macOS, you can install most dependencies using Homebrew:
brew install cmake glfw glew fftw portaudio libsndfileThe project uses some external dependencies that are included as Git submodules:
- Dear ImGui: UI library
- Native File Dialog Extended: Cross-platform file dialog library
Clone these submodules after cloning the main repository:
git submodule update --init --recursive-
Clone the repository:
git clone https://github.com/your-username/audio-visualizer.git cd audio-visualizer -
Initialize submodules:
git submodule update --init --recursive
-
Create a build directory and navigate into it:
mkdir build && cd build
-
Generate the build files with CMake:
cmake ..
-
Build the project:
make
-
Run the application:
./AudioVisualizer
Once the application is running:
- Use the dropdown menu to select an audio input device
- Choose your preferred visualization style (Bar Graph, Circular, or Wave)
- Adjust the "Rotation Speed" and "Zoom Level" sliders to customize the visualization
- Modify the color scheme using the color pickers
- Open the "Audio Processing" section to adjust smoothing and gain parameters
- Use the "File Playback" section to open audio files, play/pause, or switch back to microphone input
Contributions to improve the Audio Visualizer are welcome. Please feel free to submit pull requests or open issues to discuss potential changes or enhancements.