Miam-Player  0.8.0
A nice music player
Chromaprint

Introduction

Chromaprint is a library for generating audio fingerprints, mainly to be used with the AcoustID service.

It needs raw audio stream (16-bit signed int) on input. The audio can have any sampling rate and any number of channels. Typically, you would use some native library for decoding compressed audio files and feed the result into Chromaprint.

Audio fingerprints returned from the library can be represented either as base64-encoded strings or 32-bit integer arrays. The base64-encoded strings are usually what's used externally when you need to send the fingerprint to a service. You can't directly compare the fingerprints in such form. The 32-bit integer arrays are also called "raw fingerprints" and they represent the internal structure of the fingerprints. If you want to compare two fingerprints yourself, you probably want them in this form.

Generating fingerprints

Here is a simple example code that generates a fingerprint from audio samples in memory:

char *fp;
const int sample_rate = 44100;
const int num_channels = 2;
chromaprint_start(ctx, sample_rate, num_channels);
while (has_more_data) {
chromaprint_feed(ctx, data, size);
}
printf("%s\n", fp);

Note that there is no error handling in the code above. Almost any of the called functions can fail. You should check the return values in an actual code.