This is a Python application that visualizes audio input as both a waveform and a spectrogram in real-time. The application supports audio input from both files and live microphones.
- Real-Time Audio Visualization: Display live spectrograms and waveforms from microphone input or audio files.
- Multiple Audio Sources: Select audio input from any available microphone or load audio files (WAV, MP3).
- Channel Selection: Choose specific channels for visualization, including mono and stereo options.
- Python 3.8 or higher
PyQt5
moderngl
librosa
matplotlib
numpy
pyaudio
You can install these dependencies using pip
:
pip install -r requirements.txt
This project expects a config.py
file containing configuration constants. Below is an example of what your config.py
might look like:
# config.py
WINDOW_WIDTH = 1280
WINDOW_HEIGHT = 720
SAMPLE_RATE = 44100
BUFFER_SIZE = 1024
WINDOW_SIZE = 1024
HOP_SIZE = 512
- Clone this repository or download the files.
- Ensure all dependencies are installed.
- Run the application using:
python main.py
- Select Audio Device: Use the dropdown menu to select an audio device for input.
- Select Channel: Choose the specific channel(s) you want to visualize (Mono or Stereo).
- Load Audio File: Click the "Load Audio File" button to choose an audio file (WAV or MP3) for visualization.
- The application window will display the following:
- Top Menu: Contains dropdowns for selecting the audio device, channels, and a button to load audio files.
- Waveform Display: The upper part of the main window shows the waveform of the audio input.
- Spectrogram Display: The lower part of the main window shows the spectrogram of the audio input.
- If the spectrogram or waveform is not displaying:
- Ensure your system supports OpenGL 3.3 or higher.
- Check the console output for any error messages or debug information.
- Make sure that the selected audio device is working correctly and receiving input.
Feel free to fork the repository and submit pull requests. Contributions are welcome... maybe.
This project is licensed under the MIT License - see the LICENSE file for details.