Coder Social home page Coder Social logo

alafanechere / harmonizer Goto Github PK

View Code? Open in Web Editor NEW
11.0 0.0 0.0 59.9 MB

Convert, normalize, enrich and validate your music library. (FLAC, M4A, MP3)

Home Page: https://imr.party

License: GNU General Public License v3.0

Python 100.00%
audio audio-processing audio-library converter mp3 flac flac-mp3 discogs spotify

harmonizer's Introduction

HARMONIZER

PyPI version PyPI - Python Version

This library helps you to convert, normalize, enrich and validate your music library. It fullfills the need we have at imr.party to harmonize the music library of our webradio.

The library comes shipped with a CLI tools which allow you to process audio files in a directory to create normalized mp3 versions of all files, enrich their metadata from various sources (Discogs, Spotify).

What it does

  • Audio conversion: Converts FLAC, MP3, AAC (m4a) to MP3 (128k, 192k, 320k).
  • Audio normalization: Peak normalize your input audio. Normalization is expressed in headroom ratio (0.1 means max peak will me 90% of the maximum volume).
  • Metadata extraction :
    • Audio tags: extracted from the audio and written to the JSON metadata results.
    • Audio fingerprinting: Chromaprint fingerprinting extracted from the audio and written to the JSON metadata results.
  • Metadata enrichment:
    • Use Discogs API to find the releases related to the audio track. Get your tokens here
    • Use Spotify API to find the audio track in their catalog. Get your API secrets here
  • Covert Art extraction (MP3 only) : extract the covert art to an image file.
  • Validation : run various integrity check to assert the input audio respects the rules you defined in the your config.
    • Minimum input bit rate (MP3 only)
    • Mandatory audio tags
    • Accepted input mime types

Outputs

All file processing will create 2 or 3 files :

  • The mp3 converted and normalized audio version of the input audio file.
  • A metadata json file (check metadata_output.json)
  • A cover art image file if present in the original file

Install

System dependency

ffmpeg:
OS X : $ brew install ffmpeg
Linux: $ sudo apt install ffmpeg

libmagic:
OS X : $ brew install libmagic
Linux: $ sudo apt install libmagic-dev

fpcalc:
Install Chromaprint and add the executable to your path.

Pip

$ pip install harmonizer

CLI usage

Usage: cli.py [OPTIONS] AUDIO_INPUT_DIR AUDIO_OUTPUT_DIR CONF

  Please provide an audio_input_dir path and an audio_output_dir path to
  launch harmonization of your files.

Options:
  --json-out DIRECTORY  Path to directory to which  JSON metadata will be
                        written to.
  --img-out DIRECTORY   Path to directory to which extracted cover arts will
                        be written to.
  --help                Show this message and exit.

Config file structure

Checkout example_config.yml.

Test

$ python setup.py test

TODO:

  • Docstrings
  • More documentation
  • Better discogs search and match algorithm
  • More pipeline control through the config

harmonizer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

harmonizer's Issues

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.