A lightweight web tool for converting audio files to mono, 8kHz, 16-bit WAV format. ππ΅
This application provides a simple web interface for converting various audio formats (primarily MP3 and WAV) to a standardized mono, 8kHz, 16-bit WAV format. It's designed to be:
- β Simple: Easy drag-and-drop interface π±οΈπ
- β‘ Fast: Asynchronous conversion with progress tracking β±οΈ
- π Secure: No permanent file storage, automatic cleanup π§Ή
- π§± Scalable: Containerized for easy deployment π³
- πͺ Reliable: Persistent task tracking for robustness π
- π Drag-and-drop file uploads
- π Real-time conversion progress indicators
- πΆ Support for MP3 and WAV input formats
- π Secure file handling with automatic cleanup
- π± Responsive design that works on mobile and desktop
- π³ Docker containerization for simple deployment
- ποΈ No permanent file storage (files automatically deleted after download)
- π "Convert Another" functionality for batch processing
- π Dark Mode / Light Mode
- π³ Docker and Docker Compose
That's it! Everything else runs inside the container. π
# Pull the latest image
docker pull ghcr.io/yourusername/wav-maker:latest
# Create a directory for persistent data
mkdir -p task_data
# Run the container
docker run -d -p 5000:5000 -v $(pwd)/task_data:/app/conversion_tasks.json --name wav-maker ghcr.io/yourusername/wav-maker:latest
-
π₯ Clone this repository:
git clone https://github.com/yourusername/wav-maker.git cd wav-maker
-
βΆοΈ Start the application with Docker Compose:docker-compose up -d
-
π Open your browser and go to:
http://localhost:5000
-
π§ Drag and drop an audio file, and the converter will do the rest!
wav_maker/
βββ app.py # π§ Main Flask application
βββ requirements.txt # π¦ Python dependencies
βββ Dockerfile # π³ Docker image configuration
βββ docker-compose.yml # π§© Docker Compose config
βββ static/ # π¨ CSS and JavaScript
β βββ style.css
β βββ script.js
βββ templates/ # πΌοΈ HTML templates
β βββ index.html
βββ tests/ # π§ͺ Unit tests
βββ test_app.py
Customize through environment variables in docker-compose.yml
:
Variable | Description | Default |
---|---|---|
MAX_CONTENT_LENGTH |
π Max upload file size (bytes) | 104857600 (100MB) |
FILE_RETENTION_MINUTES |
π File retention before cleanup | 30 |
Powered by pydub
+ FFmpeg:
- Convert to mono π£οΈ
- Resample to 8kHz ποΈ
- Encode to 16-bit PCM π§±
- Export as WAV π€
- π Each conversion has a unique task ID
- πΎ Task status is persistently stored
- π Status is tracked through the entire process
- π§Ή Auto-cleanup of old tasks and files
- π§ Runs as non-root in Docker
β οΈ File size limits prevent DoS- π§Ό Temp storage prevents bloat
- π§― Sanitized filenames = no path traversal
To modify and test:
-
Edit source files βοΈ
-
Rebuild & restart Docker:
docker-compose up --build -d
Run the test suite with:
# Install test dependencies
pip install pytest pytest-cov
# Run tests
pytest tests/ --cov=app
-
Install dependencies:
pip install -r requirements.txt
-
Install FFmpeg:
- π§ Ubuntu/Debian:
sudo apt-get install ffmpeg
- π macOS:
brew install ffmpeg
- πͺ Windows: Download
- π§ Ubuntu/Debian:
-
Run app:
python app.py
This project uses GitHub Actions for continuous integration and delivery:
- π§ͺ Automatic testing on push and pull requests
- π³ Docker image building and publishing to GitHub Container Registry
- π¦ Automatic release creation on version tags
-
β "File not found or conversion not complete"
- File was likely already deleted. Try again.
-
β "Error during conversion"
- Check file format and FFmpeg install.
-
β Container won't start
- Check for port conflicts:
sudo lsof -i :5000
- View logs:
docker-compose logs
- Check for port conflicts:
Follow logs in real-time:
docker-compose logs -f
MIT License β see the LICENSE file π