libdiscid  0.6.2
libdiscid

Introduction

Libdiscid is a C library for calculating DiscIDs (MusicBrainz and freedb) for Audio CDs. Additionally the library can extract the MCN/UPC/EAN and the ISRCs from disc.

The idea is to have an easy to use library without any dependencies that can be used from scripting languages.

The API is documented in discid.h.

Examples

This is an example of the most basic usage:

DiscId *disc = discid_new();
if ( discid_read_sparse(disc, "/dev/cdrom", 0) == 0 ) {
fprintf(stderr, "Error: %s\n", discid_get_error_msg(disc));
return 1;
}
printf("DiscID : %s\n", discid_get_id(disc));
printf("Submit via : %s\n", discid_get_submission_url(disc));
discid_free(disc);

Building

libdiscid provides a pkg-config script that returns the necessary compiler and linker flags, as well as the version number. To build a small sample program one would use:

gcc libdiscid-test.c `pkg-config libdiscid –cflags –libs` -o libdiscid-test

Contact