Skip to main content

MP3 song normalizer

Project description

Trimmer

MP3 song normalizer

GitHub version (latest SemVer) Github Pages PyPI codecov

Do you find it annoying when songs on YouTube are recorded quietly and there is a long silence before and after the song?

Trimmer corrects this by generating the normalized MP3 for you:

  1. Downloads a song from a URL on Youtube (thanks to youtube-dl and yt-dlp)
  2. Trims down the silence at the beginning and at the end of a song (thanks to pydub)
  3. Normalizes volume (detects clipping), and applies fade-in and fade-out (thanks to pydub)
  4. Adds MP3 ID3 tags - both ID3v1 & ID3v2 (thanks to eyed3)
  5. Creates an mp3 file with a unified name Artist - Title.mp3

Downloading MP3

Create trimmed, normalized and tagged mp3 from Youtube URL:

trimmer https://www.youtube.com/watch?v=dQw4w9WgXcQ

Usage example

Editing MP3

trimmer "unknown001.mp3"

From this:
unknown001.mp3
Usage example
trimmer does that:
Mike Oldfield - Tubular Bells Part I.mp3
Usage example

You can also trim song manually using --trim-start and --trim-end (e.g. for cutting long applause at the end of song).

Installation

pip3 install trimmer

It requires Python 3.6 (or newer) with pip.

For Linux make sure that required libs are installed: apt install ffmpeg libavcodec-extra

For Windows you might need to put ffmpeg binaries to PATH.

Upgrading

Keep up-to-date frequently changing dependencies (due to Youtube API changes):

pip3 install --upgrade --upgrade-strategy eager trimmer

or do the same with:

trimmer --upgrade

Help

$ trimmer --help
trimmer v1.0.0 (nuclear v1.3.4) - MP3 song normalizer

Usage:
trimmer [OPTIONS] SOURCE

Arguments:
   SOURCE - song source (youtube URL or MP3 file)

Options:
  --version                   - Print version information and exit
  -h, --help [SUBCOMMANDS...] - Display this help and exit
  --artist ARTIST             - song artist
  --title TITLE               - song title
  --trim-start TRIM_START     - trim given seconds at the beginning
  --trim-end TRIM_END         - trim given seconds at the end
  --gain GAIN                 - increase volume by given dB
  --output OUTPUT             - output MP3 file (Artist - Title.mp3 by default)
  --no-normalize              - skip normalizing volume level
  --no-trim                   - skip trimming silence at the edges of song
  --no-fade                   - skip applying fade-in & fade-out
  --no-rename                 - skip renaming song to normalized filename (Artist - Title.mp3)

Install locally in develop mode

make setup
. venv/bin/activate

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trimmer-1.1.1.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

trimmer-1.1.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file trimmer-1.1.1.tar.gz.

File metadata

  • Download URL: trimmer-1.1.1.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for trimmer-1.1.1.tar.gz
Algorithm Hash digest
SHA256 0723f8377b88abfc14de1d2a07bd275a2cb562ed8600a2866b52d6da1409521d
MD5 0acfa4255b819e3fb36e950727b2e719
BLAKE2b-256 6e78cc96cfd3aef44a14bef647143ddb395a3b3bec0752293f0397ba28dc9a81

See more details on using hashes here.

File details

Details for the file trimmer-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: trimmer-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for trimmer-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 56e5549bd6e48dc178d43e4c567b7b93be41988fcc29f82086db757d7f4e3277
MD5 19d91d9131495db33575fce0e946f145
BLAKE2b-256 0c415b63d3a42392fc435e36bd33b4e30e7e8e22d0e62365de41af14dfa1a50d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page