Digitizing Vinyl

[Josh Wheeler]

Categories: audio

Record Audio from the Command Line

arecord -d 2000 -f cd -t wav filename.wav

Record for a total of 2000 seconds or 33.33 minutes (average duration of a vinyl LP).

Add Audacity Labels and Export

Open Audacity and add labels to mark each track

C-b to insert label at point

After labels are added, export with File > Export Labels…

# cat Label\ Track.txt
0.000000        0.000000        Little Deuce Coupe
100.386393      100.386393      Ballad of Ole' Betsy
237.597057      237.597057      Be True To Your School

Convert Labels to cue sheet

Use label2cue to convert Audacity label export to cue sheet.

label2cue Label\ Track.txt -o cdda.cue

Cue sheet should look like this

TITLE "UNKNOWN ALBUM"
PERFORMER "UNKNOWN ARTIST"
FILE "UNKNOWN.FILE" WAVE
REM NEW-TRACK
  TRACK 01 AUDIO
  TITLE "Little Deuce Coupe"
  INDEX 01 00:00:00
REM NEW-TRACK
  TRACK 02 AUDIO
  TITLE "Ballad of Ole' Betsy"
  INDEX 01 01:40:28
REM NEW-TRACK
  TRACK 03 AUDIO
  TITLE "Be True To Your School"
  INDEX 01 03:57:44
REM END-TITLE

Split to individual files based on cue sheet

Use shnsplit (part of the shntool package in debian) to split individual files based on cue sheet.

shnsplit -f cdda.cue -t "%n %t" cdda.wav

Note: cdda.wav sample rate must be 44.100k or the cue sheet will split at invalid times.

Normalize

normalize-audio -b *.wav

Note: normalize-audio may be called normalize in other distributions like Fedora.

Optionally use or remove the batch mode flag (-b) when appropriate. Batch mode is used to preserve mastering of the album, but normalize the overall album’s volume to 0 dB. In addition to this, it will also fix any tracks that are drastically lower than the rest of the album. Without -b, each track would be normalized on its own without context.

Encode

Encode to a free codec like flac, opus, or ogg

ogg is similar in quality to mp3; opus is slightly better than aac; and flac is completely lossless after decoding.

flac

Encode all wav files to flac

flac *.wav

opus

opus is excellent for speech and music; great for storage and streaming.

for i in *.wav; do
opusenc --cvbr --bitrate 128 "${i}" "${i%.*}.opus"
done