Skip to main content

Create and synchronize transcoded copies of audio folders

Project description

PyPI Version

Create and synchronize transcoded copies of audio folders.

  • Transcodes FLAC files to MP3 or Opus with tags

  • Copies everything else as-is

  • Parallelized

  • Additional runs synchronize changes since the initial run

  • Configurable encoders

History

My audio library is a comprised of FLAC’s, MP3’s, cover images, and various metadata files - totaling roughly 500GB. This is not a problem when I’m on my desktop - wired into the same network as my server. However, my laptop and phone use often suffers from poor connectivity and limit storage capacities. Further, lossless audio often is a waste as the my laptop and phone used in less-than-ideal environments and equipment. Thus, I decided to use only MP3’s on those devices.

Previously, I was solving this with a combination of mp3fs and rsync. This served me well for a number of years, but had a few drawbacks for my uses.

  • Only MP3 - Cannot experiment with formats like Opus without implementing support in mp3fs’s C codebase.

  • Only CBR MP3 - LAME’s V0 often is indistinguishable from 320 CBR while reducing the file size by ~15%.

  • Uses FUSE - Makes containerization and portability more complicated.

  • Not Parallelized - On a system with eight logical cores and competent disk speeds, encoding a one file at a time is a gross inefficiency.

Harmonize transcodes to LAME V0, has no dependency on FUSE, and supports parallel copying and transcoding. While it currently only transcodes to MP3, it’s written in Python. This is far more accessible to modification for a Pythonista like myself.

Installation

If installing from PyPI or using the script directly, ensure the following are installed:

  • Python 3.6+

  • FLAC

  • LAME (when using mp3)

  • opusenc (when using opus)

Usage

usage: harmonize [-h] [--codec {mp3,opus}] [-n NUM_PROCESSES] [-q] [--version]
                 source target

positional arguments:
  source              Source directory
  target              Target directory

optional arguments:
  -h, --help          show this help message and exit
  --codec {mp3,opus}  codec to output as. encoder configuration may be
                      specified as additional arguments to harmonize
  -n NUM_PROCESSES    Number of processes to use
  -q, --quiet         suppress informational output
  --version           show program's version number and exit

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

harmonize-1.0.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

harmonize-1.0.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file harmonize-1.0.0.tar.gz.

File metadata

  • Download URL: harmonize-1.0.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.8.0

File hashes

Hashes for harmonize-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ead1c072c87ca3ca3050e43ccef365a9ff0a62d80054e482e2a134dd3b98413e
MD5 ea23beadb281709250ff9bed77a0502e
BLAKE2b-256 3ac2b8b0f0d512f3e51bf1a00a3c3c0a3d625de4f9dd21afdf70a6281fde7425

See more details on using hashes here.

File details

Details for the file harmonize-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: harmonize-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.8.0

File hashes

Hashes for harmonize-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d9599332cadc03e989fae0e10a244f0b7449714a233c471e36fe080b913b4e3
MD5 1cdac8d0ee3d5c5df0c0b6a580730406
BLAKE2b-256 5dc68c46071c2dc20cc0eb08b8aa5b8ceb1133951fa56c2d1847d70d95f5d662

See more details on using hashes here.

Supported by

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