Giter VIP home page Giter VIP logo

mp3-split's Introduction

mp3-split README

mp3-split is a command-line utility that splits a long MP3 file into smaller files and then tags them with the track name and track number.

Development

  • Python 3.7+
  • PyYAML
  • python-ffmpeg

ffmpeg is an external dependency and needs to be present on your path.

Usage

Usage: mp3-split INPUT_FILE CONFIG_FILE

Example CONFIG_FILE layout:

artist: "A band"
title: "An album"
tracks:
  - name: Track Name 1
    offset: "0:00"
  - name: The Second Track
    offset: "3:26"
  - name: A Third Piece
    offset: "26:01"

Files will be created in [ARTIST]/[ALBUM]/, which will be created if it does not exist.

Setting the LOGLEVEL=DEBUG environment variable will show debug output.

Improvements

  • Converted to use Poetry, making the script installable.
  • Included the track number in the filename.
  • Removed the need for subprocess shells.
  • Removed dependencies on eyeD3 and mp3info, handling these using the Python ffmpeg bindings instead.
  • Significant code cleanup including a ~50% length reduction.
  • Added doc strings to all functions.
  • Added a VSCode devcontainer configuration for easier dependency management.
  • Added pre-commit checks.
  • Converted the config file to YAML, enabling easier parsing and adding more optional tags, starting with artist and album name.
  • Quietened output by default, using the logging module to specify log level.
  • Converted to use Click for CLI handling, simplifying argument parsing and file access.
  • Removed a lot of unnecessary re-computing of information already in the config file; only the total length needs to be computed.

TODO

  • Remove the external dependency on the ffmpeg binary, such as by switching to PyAV.
  • Add tests.
  • Genericise to work on non-MP3 files where possible.

Credits

mp3-split's People

Contributors

thumperward avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.