Components
File: CDDB Protocol Client in C#
- Uploaded:
- April.06.09
- Modified:
- June.21.10
- File Size:
- 70 KB
- Downloads:
- 556
- Version
- 1.0
An asynchronous CDDB protocol client written in C#. Connects to CDDB servers using the CDDB protocol instead of HTTP and supports protocol level 1-6 (including UTF-8 text). Can query the server for a list of matching albums and decode the CDDB database entry when a specific album is queried.
Details
I needed a CDDB client to be able to verify my audio collection (ripped to the FLAC format) against the AccurateRip database because I ripped my CDs as individual tracks, so the exact track offsets of the songs were lost.
There seemed to be no C# implementations of the CDDB protocol available, so I rolled my own!
Because accessing the web can take time, this code makes uses of my asynchronous transaction API.
All methods return Requests which you can wait on (using .Join()) or
register to be notified when they finish.
First, you need to connect to a CDDB server. Nuclex.Cddb uses freedb by default:
Next, you should upgrade the protocol level to get UTF-8 support:
Then you can query the server for the album of your choice:
Simple, isn't it?
Features
- Calculates CDDB disc ids from track offset lists
- Connects to CDDB servers using the CDDB protocol (not HTTP)
- Support for CDDB protocol levels 1-6 (including UTF-8 text)
- Lists album categories supported by a CDDB server
- Queries CDDB servers for any albums matching a list of track offsets
- Reads and decodes CDDB database entries so they can be processed by code
- Specific exceptions for each error and capturing of error messages from the server
The CDDB protocol client is part of the Nuclex.Audio library from the Nuclex
Framework. You can find the most recent release of the code on the framework's CodePlex site:
http://nuclexframework.codeplex.com/