February 27, 2024

Playing disks and online audio

Many of my disks have CD roms in a back pocket. Of course playing those with a CD player is a pretty simple thing. Ultimately I would like to "rip" those disks to audio (mp3) files and store them on my computer, then play them from there. So this page will be notes on how to do all of this using my linux computer.

Online content

My book "Bluegrass Banjo for the complete Ignoramus" has online content. A much nicer option, both for the publisher and for me: The download button gives me a zip file. I unzip it to the directory /u1/Projects/Banjo/Ignoramus on my machine, and I have 99 mp3 files!
su
dnf install ffmpeg-free
ffplay 64.mp3
However, ffplay is incredibly stupid and will run forever even though it has played the entire file. You can fix this with:
ffplay -autoexit 64.mp3
ffplay -autoexit -loop 10 64.mp3
ffplay -nodisp -autoexit 64.mp3
The second option plays the sound over and over as many times as you like. The third option gets rid of the cute graphical display.

Note that some mp3 files use proprietary codecs and will require getting software from outside the country. This is not a problem with the "ignoramus" files thankfully. Very likely there are nice GUI mpeg players that I can learn about.

Since I find it annoying to type "-autoexit" all the time, I create a script I call "play" which also adds the ".mp3" extension, so I can just type:

play 64
So this works via the command line

The Triscka CDROM

I "ripped" this many years ago (back in 2011), but when I track down those files, I only see this:
/u1/tom_archive/cd_archive/Audio/banjo_trischka
-rw-r--r-- 1 tom tom     19019 Sep  5  2011 cd.toc
-rw-r--r-- 1 tom tom 538951392 Sep  5  2011 data.bin
No collection of mp3 files for each track. This worked nicely to allow me to duplicate the disk (which I did because I was worried about damaging the original), but I'll have to do some more learning to figure out how to get individual files for each track. I don't much care if those files are wav, mps, ogg, or whatever.

Ripping in 2024

A tool called "asunder" is recommended and is already installed on my fedora system. It says it is an application to save tracks from an audio CD as wav, mp3, ogg, or any number of other formats. Sounds promising.

I insert my Trischka disk (actually a copy I burned back in 2011) and start asunder. It tries to get info on it from the internet, quickly fails, then shows me a "menu" of tracks. There are 98 of them. There is a "rip" button at the lower right. I click it, and it gets busy doing something. It shows me a progress bar with indications of percent (of total) and the track number.

I could have used the preferences tab to set a variety of things, such as:

destination folder
filename template
output format
compression/quality
By default it created a folder right under /home/tom called "Unknown Artist - Unknown Album" and inside it is accumulating a bunch of "ogg" files with names like:
50 - Unknown Artist - Track 50.ogg
I see a file "x52.wav" come and go -- so apparently the data first comes off the disk as a ".wav" file, but then gets converted to whatever format you selected.

It works! I move the folder to /u1/Projects/Banjo/Trischka. I spend some time trying to work up a bash "play" script to deal with these horrible filenames with embedded blanks and give up. Instead I write a ruby script to rename all the files. In the future I will change the asunder preferences to make sensible filenames.

ff = Dir[ "*.ogg" ]
ff.each { |f|
    fn = f.sub( /^.. - Unknown Artist - Track /, "" )
    File.rename( f, fn )
}
Once this was done, I made a script "tplay" to play any track from the Trischka disk. I also changed my "play" script to "iplay" and it looks like this:
fname=/u1/Projects/Banjo/Ignoramus/$1.mp3
ffplay -nodisp -autoexit $fname
Simple enough, now I can use them from anywhere and either "iplay 13" or "tplay 13" plays the desired track from either disk.


Have any comments? Questions? Drop me a line!

Tom's home page / [email protected]