This article describes how to rip an Audio CD in KDE using the powerful KIO-Slave mechanism, one of the core components of KDE.

Last Updated: 19 September, 2004.
Prelude

The conventional way of ripping Audio CDs to mp3 or ogg files is to use a standalone program such as iTunes, Winamp or KDE's own KAudioCreator. But if we stick to conventions, where's the fun?! So in this article, I am going to show you how to feel elite by ripping your CDs in the, umm.. elite way. ;-)

Ingredients

What do we need to be cool? Vanilla KDE, without any extra ingredients, will be able to rip your CDs. But to encode them, you'll need to install the relevant codecs. As of now, Ogg Vorbis, MP3 and FLAC formats are supported. To enable encoding to these formats, you'll have to install libogg, lame and flac respectively. How exactly you install these depends on your Linux distribution and this detail is completely and totally beyond the scope of this article.

Once you have your favourite codec(s) installed, open KDE's Control Center and navigate your way to Sound & Multimedia >> Audio CDsand configure the settings on the various tabs to your liking. You can leave everything in the default state if you so wish, but it's helpful to take a look so you at least know what's on offer. Again, take a look at Sound & Multimedia >> CDDB Retrieval and change anything that's not to your liking. CDDB, in case you didn't know, stands for CD DataBase (or Compact Disc DataBase in it's more free flowing form). This functionality enables KDE to retrieve the Artist/Album/Track information about your CDs from the Internet. This metadata is also used to write tags to the mp3 or ogg files that you'll be encoding your CDs to anytime now.

rip config screenshot

Recipe

Without further delay, let's get down to the business of being cool. First, pop in the CD you want to rip (obviously!). Next, fire up a Konqueror window and open the Services tab on the Navigation panel. The Navigation panel sits on the left side of the window, as shown in the screenshot below. If it's not visible, you can produce it out of thin air by pressing the magic F9 key.

Konqueror Services tab

Now click on Audio CD Browser and in a few seconds, you'll see a lot of folders which you can start browsing. If it's taking some time to show anything, it's because it's trying to fetch information about the CD from the CDDB database you configured earlier.

In the screenshot below, you can see the contents of the Ogg Vorbis folder. It shows all the songs in the ogg format, it even shows their file size! But, you and I both know that Audio CDs don't contain ogg tracks. So what exactly is happening here?

Ogg Virtual Folder

All the folders you see under Audio CD Browser are virtual folders. They show contents of the CD through different filters, so to speak. When you open the Ogg Vorbis folder, you are actually seeing the contents of the CD as if it were stored in the ogg format. You can go through the other folders and you'll find mp3, flac and wav representations of the CD's contents. You can even see the approximate file sizes when encoded in the various formats.

So how do we rip and encode the CD? I think you can guess the answer by now. Just decide which format you wish to rip to, open that folder, and copy and paste those files in your target folder. That's it! KDE will start ripping and encoding the files on the fly! If you copy any of the files in the 'Full CD' folder, you'll be ripping the entire CD as one continuous stream.

ripping

audiocd:/

In the KDE scheme of things, the KIO library handles input-output operations for all applications and strives to do so in a device and network transparent manner. What this means is that if you write a text document in KWrite and while saving it, specify the save path as 'ftp://joeuser@ftp.mydomain.com/myfile.txt', then the KIO library will automatically figure out how to save the file to the specified ftp server without you or the application having to worry about how to do it.

KIO gets it's brains from the so called I/O Slaves. When you save a file to an ftp server as mentioned above, KWrite hands over the task of saving the file to the KIO library which in turn hands over the job to the I/O Slave responsible for the ftp:/ protocol. The Audio CD Browser in implemented on top of the audiocd:/ protocol, a special protocol registered with KDE just like ftp:/ and http:/ protocols. (If you look at the location bar in Konqueror when browsing your Audio CD, you'll find it to show audiocd:/)

When we fired up the Audio CD Browser in Konqueror, the I/O Slave responsible for the audiocd:/ protocol was brought into action and it went about retrieving CDDB information, calculating approximate target file sizes and showing us the pretty folder layouts. When we actually copied some tracks, Konqueror issued a copy request to the KIO library which in turn called the audiocd:/ I/O Slave to supply the file and the file:/ I/O Slave to take the file and save it. Yes, even file: is a protocol and is dealt with just like the others.

All this means that you can load your data from (and save to) practically anywhere - Windows (SMB) shares, NFS volumes, FTP servers, digital cameras - all from the standard 'File Open' and 'File Save' dialog boxes. Just as an example, I'll show you how I add new posts to my blog. Blosxom, the blogging tool I use, records posts as plain text files. So I write a new blog post in KWrite, open the 'Save File' dialog box and click on the link which points to my ftp server. A dialog pops up asking me for the ftp server's password which I supply without hesitation (it's my ftp account!). The Save box then shows me the file listing from the ftp server. I browse to the appropriate folder, save my file which is automagically ftped to the server and that's it! No mucking around with an ftp client or anything - just fire and forget!

As you can very well imagine, the KIO library along with the I/O Slaves offers powerful tools which can make your life considerably easier - at least if you spend a considerable part of your life on your computer! There are quite a few other protocols which are interesting such as zip:/ and tar:/ which let you browse inside zip and tar files; camera:/ which exposes your digital camera just like audiocd:/ exposes your audio cds; drives:/ which shows all local disk drives, fish:/ which acts as if you were running a graphical ssh connection; sftp:/ which lets you securely copy files across the network and many more.

You can see all the protocols registered with KDE using the KDE Info Center tool.

Elsewhere

A high level overview of KDE's I/O Architecture.
Documentation for the audiocd:/ I/O Slave. (Extremely outdated!)
A gentle introduction to the I/O architecture.
KDE's I/O Architecture from a developer's perspective.