The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

Rip CDs from the command line

Contributed by: Scot Hacker
This tip is valid for: Both BeOS and Haiku

There are a number of great ripping and encoding solutions available for BeOS, including RipEnc. And you can always save CD audio tracks straight to AIFF or WAV directly from CDPlayer.

But unbeknownst to many, BeOS also includes a command-line CD player and ripper that works from the shell. To learn its usage, just type


without any arguments. The command will report the path to your raw CD device, along with all allowable arguments and parameters. You’ll see something like this:

Usage:  play device [command [param]]

 Valid devices:

 Valid commands:
   0 [n] - play from track n [1]
   1     - pause
   2     - resume
   3     - stop
   4     - eject
   5 n   - set volume to n (0 <= n <= 255)
   6     - current position
   7 n s - save track n to file s
   8 [c] - scan in direction c (f = forward, b = backward)

So to play track 7 on this system, you would type:

play /dev/disk/ide/atapi/0/slave/0/raw 0 7

because 0 means play, and 7 is the track number, fed to play as an argument. Of course you’ll need to change the path to the CD device to reflect your own system. To save track 7 to disk as raw audio, use something like:

play /dev/disk/ide/atapi/0/slave/0/raw 7 7 ~/data/sounds/filename.raw

Obviously, it would be a simple matter to write a script that would take the number of tracks on a CD as an argument, and rip the whole thing to disk.

Posted in Audio & Video

(comments are closed).