Skip to content

tmc3221/AudioVisualizer

Repository files navigation

AudioViz - Xbox 360 Style Music Visualizer

A Python desktop application that recreates the classic Xbox 360 music visualizer experience with modern audio processing and smooth animations.

AudioViz Demo License

Features

Two Visualization Modes:

  • Vertical Bar Spectrum: Classic equalizer-style bars with smooth color gradients
  • Circular/Particle Mode: Dynamic particle system reactive to bass, mids, and highs

🎵 Multiple Audio Sources:

  • Download and visualize audio from YouTube URLs
  • Load local audio files (MP3, WAV, M4A, FLAC, OGG)

🎨 Xbox 360 Inspired Design:

  • Adaptive color schemes with smooth transitions
  • Blue → Cyan → Green → Yellow → Red gradient
  • Fluid animations synchronized to audio

🎛️ Full Playback Controls:

  • Play, Pause, Stop controls
  • Volume adjustment
  • Real-time FFT analysis (32 frequency bands)

Installation

Prerequisites

  1. Python 3.8 or higher

    python --version
  2. FFmpeg (required for audio file conversion)

    • Windows: Download from ffmpeg.org and add to PATH
    • Linux: sudo apt-get install ffmpeg
    • macOS: brew install ffmpeg

Install Dependencies

pip install -r requirements.txt

Or install manually:

pip install PyQt6 pyqtgraph numpy scipy librosa soundfile pydub pytube pygame

Usage

Run the Application

python aurora_visualizer.py

Using the Application

  1. From YouTube:

    • Paste a YouTube URL in the input field
    • Click "Download & Visualize"
    • Wait for download and processing to complete
  2. From Local File:

    • Click "Choose Local File"
    • Select an audio file (MP3, WAV, M4A, etc.)
    • Audio will be loaded automatically
  3. Choose Visualization Mode:

    • Select "Vertical Bar Spectrum" for classic equalizer bars
    • Select "Circular/Particle Mode" for dynamic particle effects
  4. Playback Controls:

    • Click ▶ Play to start audio and visualization
    • Use ⏸ Pause to pause playback
    • Click ⏹ Stop to stop and reset
    • Adjust volume with the slider

Technical Details

Audio Processing

  • FFT Analysis: Real-time Fast Fourier Transform on 2048-sample chunks
  • Sample Rate: 44.1 kHz
  • Frequency Bands: 32 logarithmically-spaced bands (20 Hz - 20 kHz)
  • Smoothing: Exponential smoothing for fluid transitions

Visualization

  • Render Rate: ~30 FPS
  • Bar Spectrum: 32 vertical bars with dynamic coloring
  • Circular Mode: 64 particles per frequency band (bass, mids, highs)
  • Color Scheme: Xbox 360 inspired gradient with amplitude-based brightness

Libraries Used

  • PyQt6: GUI framework
  • PyQtGraph: Real-time visualization rendering
  • librosa: Audio loading and processing
  • scipy: FFT computations
  • pygame: Audio playback
  • pytube: YouTube audio download
  • pydub: Audio format conversion

Troubleshooting

YouTube Download Issues

  • Error: pytube not available: Install with pip install pytube
  • Download fails: YouTube may have changed their API. Try these alternatives:
    1. Use the local file option instead
    2. Manually download audio using yt-dlp: yt-dlp -x --audio-format wav <URL>
    3. Install yt-dlp as alternative: pip install yt-dlp (requires code modification)

Audio Playback Issues

  • No sound: Check volume slider and system audio settings
  • Crackling audio: Try adjusting the buffer size in the code (pygame.mixer.init buffer parameter)

FFmpeg Not Found

  • Ensure FFmpeg is installed and added to your system PATH
  • Test with: ffmpeg -version

Performance Issues

  • Close other applications consuming CPU
  • Try reducing the number of particles or bars in the code
  • Ensure your system supports hardware acceleration for graphics

File Structure

AudioVisualizer/
├── aurora_visualizer.py   # Main application (single file)
├── requirements.txt       # Python dependencies
└── README.md             # This file

System Requirements

  • OS: Windows 10+, macOS 10.14+, Linux (Ubuntu 20.04+)
  • Python: 3.8 or higher
  • RAM: 4 GB minimum, 8 GB recommended
  • CPU: Multi-core processor recommended for smooth visualization

Known Limitations

  • YouTube download may fail due to pytube compatibility with YouTube changes
  • Large audio files (>100 MB) may take time to load
  • Visualization performance depends on system resources

Contributing

Contributions are welcome! Feel free to submit issues or pull requests.

License

This project is open source and available under the MIT License.

Credits

Inspired by the iconic Xbox 360 music visualizer. Built with modern Python libraries for audio processing and visualization.


Enjoy your music with stunning visualizations! 🎵✨

About

Xbox 360 Audio Visualizer in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages