Skip to content
rimaoutPublic

About

Python-based CLI audio format converter specifically designed for FLAC to MP3 conversions.

Resources

Stars

2 stars

Watchers

2 watching

Forks

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

flac2mp3

Python-based CLI audio format converter specifically designed for FLAC to MP3 conversions.

Features

  • Multi-threaded: Fast conversion using concurrent processing.
  • Non-Destructive: Your original FLAC files and directory structure are never deleted or modified. The program creates a completely new output.
  • Recursive: Converts files in a directory and its subdirectories.
  • Smart: Copies non-FLAC files (images, logs, etc.) to the output directory to preserve album structure.
  • Metadata Preserved: Keeps ID3 tags (Artist, Album, Title, etc.) intact during conversion.

Install Package

pip install flac2mp3-cli

Prerequisites

  • FFmpeg: This tool requires ffmpeg to be installed on your system, see: https://ffmpeg.org/download.html to install guide.
  • Python 3.8 or higher is recommended.

Usage

Basic Command:

flac2mp3 <input_path>

Note: The <input_path> is strictly read-only. The converter creates a new file or directory for the results.

Flag Argument Description Default
-t thread_count Number of threads to use for conversion. 1
-o output_path Directory to save converted files Input path
-b bitrate MP3 Quality (1-5). See key below. 5 (320k)
-ow Overwrite output files if they exist False

Bitrate Key: 1: 96k, 2: 128k, 3: 192k, 4: 255k, 5: 320k

Examples

  1. Convert a single file:
flac2mp3 "/music/Artist/Song.flac"

Creates Song.mp3 in the same folder of the given input file, in this case is saved in /music/Artist/Song.mp3. The original FLAC remains untouched.

  1. Convert a directory with 4 threads:
flac2mp3 "/music/MyAlbum" -t 4

The output is saved in "/music/MyAlbum_converted"

  1. Convert to a specific output folder with 192k bitrate:
flac2mp3 "/music/MyAlbum" -o "/mp3_collection/MyAlbum" -b 3

Development / Build from Source

If you want to contribute or build the project locally:

  1. Clone the repository:
git clone https://github.com/rimaout/flac2mp3.git
  1. Install locally:
cd flac2mp3
pip install .

Dependencies

This program uses the following Python packages:

Python Packages:

  • alive_progress (UI/Progress bars)
  • mutagen (Metadata handling)

System Dependencies:

  • ffmpeg (Core audio conversion)

Note: see https://ffmpeg.org/download.html for ffmpeg to installation guide.

License

This program is released under the MIT License. See the LICENSE file for more details.

About

This project was born out of a personal need. I needed a tool that could convert my extensive library of FLAC files to MP3 format all at once. This would allow me to enjoy my music collection on devices that don't support FLAC.

This is one of my first projects and I'm still learning, so feel free to correct me or suggest improvements.

About

Python-based CLI audio format converter specifically designed for FLAC to MP3 conversions.

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages