#!/bin/bash # Clean-Tracks Setup Script echo "Setting up Clean-Tracks audio censorship system..." echo "================================================" # Check Python version python_version=$(python3 --version 2>&1 | grep -oE '[0-9]+\.[0-9]+') required_version="3.11" echo "Checking Python version..." if [ "$(printf '%s\n' "$required_version" "$python_version" | sort -V | head -n1)" != "$required_version" ]; then echo "❌ Python $required_version or higher is required (found $python_version)" exit 1 fi echo "✓ Python $python_version" # Create virtual environment if it doesn't exist if [ ! -d "venv" ]; then echo "Creating virtual environment..." python3 -m venv venv echo "✓ Virtual environment created" else echo "✓ Virtual environment exists" fi # Activate virtual environment source venv/bin/activate # Upgrade pip echo "Upgrading pip..." pip install --upgrade pip > /dev/null 2>&1 # Install core dependencies first (smaller packages) echo "Installing core dependencies..." pip install pydub numpy click rich python-dotenv > /dev/null 2>&1 echo "✓ Core dependencies installed" # Install audio processing libraries echo "Installing audio processing libraries (this may take a few minutes)..." pip install librosa soundfile > /dev/null 2>&1 echo "✓ Audio libraries installed" # Install web dependencies echo "Installing web framework..." pip install Flask Flask-CORS Flask-SocketIO > /dev/null 2>&1 echo "✓ Web framework installed" # Install remaining dependencies echo "Installing remaining dependencies..." pip install SQLAlchemy alembic requests tqdm python-Levenshtein fuzzywuzzy > /dev/null 2>&1 echo "✓ Additional dependencies installed" # Check if ffmpeg is installed echo "" echo "Checking for ffmpeg..." if command -v ffmpeg &> /dev/null; then echo "✓ ffmpeg is installed" else echo "⚠ ffmpeg not found. Audio processing may be limited." echo " Install with:" echo " macOS: brew install ffmpeg" echo " Ubuntu: sudo apt-get install ffmpeg" echo " CentOS: sudo yum install ffmpeg" fi echo "" echo "================================================" echo "✅ Setup complete!" echo "" echo "To activate the environment and run tests:" echo " source venv/bin/activate" echo " python tests/test_audio_processing.py" echo "" echo "To start the web interface (coming soon):" echo " python -m src.web.app"