Coder Social home page Coder Social logo

martinbarker / vinyl2digital Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 1.0 7.26 MB

Batch render an Audacity audio track into an entire album of mp3 files using a Discogs URL for metadata tagging.

License: MIT License

Python 100.00%
python audacity pip mod-script-pipe audio

vinyl2digital's Introduction

Vinyl2Digital - PyPi Package

==================================

Vinyl2Digital is a Python3 Pip Package for batch rendering multiple audio files using the Audacity mod-script-pipe.

Install with pip install vinyl2digital

Update with pip install --upgrade vinyl2digital

PyPi version PyPI - Downloads PyPI - License PyPI - Python Version

Demonstration gif

Table of content

Installation

  • Install the package with this command:
pip install vinyl2digital

Setup

  • Enable mod-script-pipe in Audacity

Enable mod-script-pipe

  • Launch Audacity from your terminal
    • Windows Command Prompt Admin
      • Navigate to Audacity executable location cd C:\Program Files\Audacity>
      • Launch Audacity: start audacity.exe
    • Mac/Linux: open -a Audacity
  • Record your audio and splice each track into its own selection (place cursor and press Ctrl+i)

Split Audio Track

* Highlight any selected region and choose File->Export->Export Selected Audio, these quality options will be what vinyl2digital uses. So if you want 24 bit FLAC files make sure that option is set in this window.

Split Audio Track

* Move your cursor to be at the start of your recording * While Audacity is open, run the vinyl2digital python package with the `-t` flag to test your connection to the Audacity mod-script-pipe.
python -m vinyl2digital -t
  • You should now be able to use the vinyl2digital package from the command line to connect with Audacity and batch render multiple audio files one after the other.

Flags

Help

  • -h
    • View the help page
  • -t
    • Test your connection to the Audacity mod-script-pipe

Input

  • -i discogs https://www.discogs.com/master/14720
    • Take a Discogs URL as input for determining how may audio files to export and what metadata to use
  • -i 12
    • Export 12 tracks using default filenames

Output Audio Format

  • -f flac
    • Export selections as flac audio files
  • -f mp3
    • Export selections as mp3 audio files

Output

  • -o "E:\martinradio\rips\vinyl\NewEnglandTeenScene"
    • Set filepath output location

Examples

  • Here are some example commands for vinyl2digital on Win10 command prompt:
  • Export tracks as flac using a Discogs URL

python -m vinyl2digital -i discogs https://www.discogs.com/release/2019460-Various-The-New-England-Teen-Scene -f flac -o "E:\martinradio\rips\vinyl\NewEnglandTeenScene" 
  • Export 5 tracks as mp3 using default filenames

python -m vinyl2digital -i 5 -f mp3 -o "E:\martinradio\rips\vinyl\NewEnglandTeenScene" 

Development

  • In order to develop and test this code locally clone this github repo:

git clone https://github.com/MartinBarker/vinyl2digital.git

  • Install the necessary packages: os, sys, requests, json, time, re
  • Run locally: python3 "vinyl2digital/vinyl2digital/__init__.py" -h

Releasing a new version:

  • Change package version number (setup.py)
$ python -m pip install --upgrade build
$ python -m build
  • This will create the dist/ folder with a new packaged tar
python3 setup.py sdist bdist_wheel
pip3 install twine
python3 -m twine upload dist/*

vinyl2digital's People

Contributors

martinbarker avatar weases avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

weases

vinyl2digital's Issues

Using Master Releases may be an issue

Hi Martin,

It may be better to use the ReleaseId rather than the MasterId when getting the details for releases, as some editions have different tracks than the master

Failure to run, tofile = open(toname, "w')

In attempting to run the program after opening audacity from both a powershell window and a standard command line, in the first attempt to run the code, regardless of whether that's using the -t flag, or just outright running an output, I'll get an error that looks like the following:
image
(roughly transcribed, it detects the mod-script-pipe, then throws an error in vinyl2digital's init.py, line 31, TOFILE = open(TONAME, 'w')
In then trying to run it a second time (whether re-running the -t flag, or attempting an output after the -t flag confirms the pipe exists and then throws that error), we get this error:
image
(transcribed, it says ..does not exist. Ensure Audacity is running with mod-script-pipe.)
For clarity, here's the output of two runs with the -t flag enabled:
image
This effect is visible both from the documentation's suggested standard command line, and from a powershell window, and remains after attempting to ensure the code is updated using pip install --upgrade vinyl2digital. My best guess as to why the runs following the first throw the audacity not connected issue is that the exception being thrown by the first run disconnects the command line from Audacity. Looking at the file mentioned in the error, the error correctly suggests that the code seems to not be able to find the path assigned to TONAME, ('\\.\pipe\ToSrvPipe') but I'm not sure how to fix that, hence the issue report!

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.