A Tkinter-based GUI application that uses Pydub to convert one or more MP3 files to WAV format. This is under heavy developmenet, and is inspired by many other tools. It was created in the heat of a fever-dream to solve something that could not be solved (as my partner didn't know how to install Python in the right drive). At the moment it does actually work, it has been tested at least on a singular file.
This Python script provides a simple graphical user interface (GUI) built with Tkinter to convert MP3 audio files to WAV format. It leverages the Pydub library for the audio processing, making the conversion process straightforward. You can select single or multiple MP3 files for conversion.
- Python 3.7 or higher: This script is designed to run on modern Python versions. While it might work on older 3.x versions, it's not guaranteed.
- FFmpeg: This is a powerful multimedia framework that Pydub relies on for encoding and decoding audio. It must be installed and available in your system's PATH.
- Python Packages:
pydub
simpleaudio
tk
(Usually included with Python installations, but good to be explicit)
If you don't have Python installed, download the latest version from the official Python website (https://www.python.org/downloads/) and follow the installation instructions. Make sure to check the box that adds Python to your PATH during installation (especially on Windows).
FFmpeg is essential for this script to function. Install it using one of the following methods depending on your operating system:
-
Install Chocolatey: If you don't have Chocolatey (a package manager for Windows), open PowerShell as an Administrator and run the following command:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Follow any on-screen prompts. You might need to close and reopen PowerShell.
-
Install FFmpeg: In PowerShell (as a regular user or Administrator), run:
choco install ffmpeg
-
Install Homebrew: If you don't have Homebrew (a package manager for macOS), open Terminal and run:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Follow any on-screen instructions.
-
Install FFmpeg: In Terminal, run:
brew install ffmpeg
Use your distribution's package manager to install FFmpeg. Here are some common examples:
-
Debian/Ubuntu:
sudo apt update sudo apt install ffmpeg
-
Fedora/CentOS/RHEL:
sudo dnf install ffmpeg # Or 'yum' on older versions
-
Arch Linux:
sudo pacman -S ffmpeg
Verify FFmpeg Installation: After installing FFmpeg, open a new terminal (or command prompt) window and type ffmpeg -version
. If FFmpeg is installed correctly, you should see version information. If you get a "command not found" or similar error, FFmpeg is not in your system's PATH. You must add the directory containing the ffmpeg
executable to your PATH environment variable for Pydub to work. Refer to your operating system's documentation for instructions on how to modify the PATH.
You can install the required Python packages using pip
, pyenv
, or uv
. pyenv
is recommended for managing multiple Python versions and project-specific environments. uv
is a fast alternative to pip.
Open a terminal or command prompt and run:
pip install pydub simpleaudio
pyenv allows you to easily switch between different Python versions and manage virtual environments.
- Install pyenv: Follow the installation instructions for your operating system on the pyenv GitHub repository: https://github.com/pyenv/pyenv#installation
- Important: Make sure to follow the instructions to configure your shell (e.g., adding lines to your .bashrc, .zshrc, or similar). You'll likely need to restart your terminal after this.
- Install a Python Version:
pyenv install 3.10
- Create a Virtual Environment: (This isolates your project's dependencies)
pyenv virtualenv 3.10 mp3-to-wav-converter
- Activate the Environment:
pyenv activate mp3-to-wav-converter
- Install Packages: Now, within the activated environment, use pip:
pip install pydub simpleaudio
uv
is a fast Python package installer and resolver. It's designed to be used within a virtual environment, and it provides its own command for creating them.
-
Install uv:
pip install uv
-
Clone the Repository (or Download the Script):
git clone https://github.com/Ktiseos-Nyx/Mp3_To_Wav.git cd Mp3_To_Wav
Alternatively, you can download the
converter.py
file directly and place it in a new directory (e.g.,Mp3_To_Wav
). Make sure youcd
into that directory. The important point is that theuv venv
command (in the next step) should be run inside the project directory. -
Create a Virtual Environment using
uv venv
: Run this command inside theMp3_To_Wav
directory:uv venv
This creates a virtual environment in a directory named
.venv
within your project directory (Mp3_To_Wav
). -
Activate the Virtual Environment (Optional, but good for clarity): Although
uv run
will automatically use the.venv
if it exists, it's still good practice to know how to activate it manually.- Linux/macOS:
source .venv/bin/activate
- Windows (PowerShell):
.venv\Scripts\Activate.ps1
- Windows (Command Prompt):
.venv\Scripts\activate.bat
- Linux/macOS:
-
Install Packages using
uv pip install
:uv pip install pydub simpleaudio
-
Clone the Repository (or Download the Script):
git clone https://github.com/Ktiseos-Nyx/Mp3_To_Wav.git cd Mp3_To_Wav
Alternatively, you can download the
converter.py
file directly. -
Run the Script (Two Options):
You have two main options for running the script, especially if you've used
uv
to manage your environment:-
Option 1: Activate the environment and run: This is the traditional approach.
source .venv/bin/activate # Or the appropriate activation command for your OS python converter.py
-
Option 2: Use
uv run
: This is more convenient, as it avoids the explicit activation step.uv run
automatically executes the command within the virtual environment (as long as a.venv
directory exists in the current working directory or a parent directory).uv run python converter.py
This command does the following:
- It finds the
.venv
environment (created byuv venv
). - It temporarily activates that environment.
- It executes
python converter.py
within that activated environment. - It deactivates the environment when the command finishes.
- It finds the
-
-
GUI Instructions:
- Click the "Browse" button to select one or more MP3 files. You can use Ctrl+Click (or Cmd+Click on macOS) to select multiple files.
- The selected files will be listed in the GUI.
- Click the "Convert" button to start the conversion process.
- The converted WAV files will be saved in the same directory as the original MP3 files, with the same filenames (but with a
.wav
extension). A message box will appear when the conversion is complete.
Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.
This project is licensed under the MIT License - see the LICENSE file for details.