compute the acoustid of a list of songs
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
static int usage(char *arg0) {
fprintf(stderr, "Usage: %s [--raw] file1 file2 ...\n", arg0);
return 1;
}
int main(int argc, char * argv[]) {
if (argc < 2)
return usage(argv[0]);
int raw = 0;
for (int i = 1; i < argc; i += 1) {
char *arg = argv[i];
if (arg[0] == '-' && arg[1] == '-') {
arg += 2;
if (strcmp(arg, "raw") == 0) {
raw = 1;
} else {
return usage(argv[0]);
}
} else {
if (!file) {
fprintf(stderr, "Unable to open %s\n", arg);
continue;
}
}
}
if (info.item) {
printf("\nduration: %f: %s\n",
info.duration,
info.item->file->filename);
if (raw) {
for (int i = 0; i < info.fingerprint_size; i += 1) {
printf("%"PRId32"\n", info.fingerprint[i]);
}
} else {
char *encoded_fp;
info.fingerprint_size, &encoded_fp) < 0)
{
fprintf(stderr, "Unable to encode fingerprint\n");
} else {
printf("%s\n", encoded_fp);
}
}
} else {
break;
}
}
while (item) {
}
return 0;
}