Saturday 12 July 2008

CDs - Playing, Ripping and XML?!?

A lot can happen in a weekend. But how about a complete CD ripper for a playout system? Not likely you'd think, but I managed to get a working CD ripper.

Ok, it's probably not the most robust of systems but it works quite nicely, even with CDs you make yourself! Though, most of the work was done for me. It actually makes use of the CD module from the BASS Audio Library. This provided me with a stream of decoded audio to throw in the general direction of oggenc2.

But there are some clever bits. For example, the track identification. I made use of the library to obtain the ISRC codes for the tracks and the identifying code to send to the Musicbrainz server.

But I mentioned XML, where does it fit in. Simple - Musicbrainz. Compared to the FreeDB system I though it would be overkill but it works quite nicely. There's also less screwing about with creating my own parser. In fact, the XmlTextReader class seemed happy enough to do the HTTP requests on my behalf.

For a CD, the tracks are return as a set of nodes, containing the title and artist in child nodes. This makes it simple to obtain the data I needed. There's actually very little code from myself processing the XML.

This makes it sound simple, right? Well, I did screw it up a bit. For a while I had an elusive bug that caused a stuttering effect in the ogg files. Turned out I had just used a wrong flag on oggenc. We all make silly mistakes from time to time... :)

1 comment:

  1. Musicbrainz Urls

    Your url was recorded with keywords musicbrainz!

    ReplyDelete