I'm writing a little script to analyze audio CDs. I'm specifically looking for a way to grab the track count from the CD, either from a shell-script or from Python. Is there an easy way to do this?
On an Ubuntu 12.04 derivative.
audio-cdpython
I'm writing a little script to analyze audio CDs. I'm specifically looking for a way to grab the track count from the CD, either from a shell-script or from Python. Is there an easy way to do this?
On an Ubuntu 12.04 derivative.
Best Answer
cdparanoia
You can get a list of CD audio tracks using the command line tool,
cdparanoia
.Example
You can count the number of lines that contain the string "OK" or that start with a number, for e.g.
1.
.cdda2wav
You can also use this command line tool,
cdda2wav
.Example
Again you can enlist the help of
grep
to get the number of tracks:References