Skip to content

A lightweight web tool for converting audio files to mono, 8kHz, 16-bit WAV format. πŸ”„πŸŽ΅

License

Notifications You must be signed in to change notification settings

RAHB-REALTORS-Association/wav-maker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Build and Publish License: MIT

WAV Maker Logo

πŸ”‰ WAV Maker

A lightweight web tool for converting audio files to mono, 8kHz, 16-bit WAV format. πŸ”„πŸŽ΅

WAV Maker Screenshot

πŸš€ Overview

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 πŸ†

✨ Features

  • πŸ“‚ 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

πŸ“Έ Screenshots

Dark Mode

Light Mode

Converted File

πŸ›  Requirements

  • 🐳 Docker and Docker Compose

That's it! Everything else runs inside the container. πŸš€

⚑ Quick Start

Using GitHub Container Registry (Recommended)

# 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

Building Locally

  1. πŸ“₯ Clone this repository:

    git clone https://github.com/yourusername/wav-maker.git
    cd wav-maker
  2. ▢️ Start the application with Docker Compose:

    docker-compose up -d
  3. 🌐 Open your browser and go to:

    http://localhost:5000
    
  4. 🎧 Drag and drop an audio file, and the converter will do the rest!

πŸ“ Project Structure

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

βš™οΈ Configuration

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

πŸ” Technical Details

🎡 Audio Conversion

Powered by pydub + FFmpeg:

  1. Convert to mono πŸ—£οΈ
  2. Resample to 8kHz πŸŽ›οΈ
  3. Encode to 16-bit PCM 🧱
  4. Export as WAV πŸ“€

πŸ” Task Management

  • πŸ“ 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

πŸ›‘οΈ Security Considerations

  • 🧍 Runs as non-root in Docker
  • ⚠️ File size limits prevent DoS
  • 🧼 Temp storage prevents bloat
  • 🧯 Sanitized filenames = no path traversal

πŸ‘¨β€πŸ’» Development

To modify and test:

  1. Edit source files ✏️

  2. Rebuild & restart Docker:

    docker-compose up --build -d

πŸ§ͺ Running Tests

Run the test suite with:

# Install test dependencies
pip install pytest pytest-cov

# Run tests
pytest tests/ --cov=app

πŸ§ͺ Local Dev Without Docker

  1. Install dependencies:

    pip install -r requirements.txt
  2. Install FFmpeg:

    • 🐧 Ubuntu/Debian: sudo apt-get install ffmpeg
    • 🍎 macOS: brew install ffmpeg
    • πŸͺŸ Windows: Download
  3. Run app:

    python app.py

πŸš€ CI/CD

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

🩺 Troubleshooting

πŸ”§ Common Issues

  1. ❌ "File not found or conversion not complete"

    • File was likely already deleted. Try again.
  2. ❌ "Error during conversion"

    • Check file format and FFmpeg install.
  3. ❌ Container won't start

    • Check for port conflicts: sudo lsof -i :5000
    • View logs: docker-compose logs

πŸ“œ Logs

Follow logs in real-time:

docker-compose logs -f

πŸ™Œ Acknowledgments

πŸ“„ License

MIT License – see the LICENSE file πŸ“˜

About

A lightweight web tool for converting audio files to mono, 8kHz, 16-bit WAV format. πŸ”„πŸŽ΅

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •