#include <stdio.h>
#include <string.h>
#include <stdlib.h>
static int usage(char *arg0) {
fprintf(stderr, "Usage: %s file1 [file2 ...] --output outputfile [--bitrate 320] [--format name] [--codec name] [--mime mimetype]\n", arg0);
return 1;
}
int main(int argc, char * argv[]) {
int bit_rate_k = 320;
char *format = NULL;
char *codec = NULL;
char *mime = NULL;
char *output_file_name = NULL;
for (int i = 1; i < argc; i += 1) {
char *arg = argv[i];
if (arg[0] == '-' && arg[1] == '-') {
arg += 2;
if (i + 1 >= argc) {
return usage(argv[0]);
} else if (strcmp(arg, "bitrate") == 0) {
bit_rate_k = atoi(argv[++i]);
} else if (strcmp(arg, "format") == 0) {
format = argv[++i];
} else if (strcmp(arg, "codec") == 0) {
codec = argv[++i];
} else if (strcmp(arg, "mime") == 0) {
mime = argv[++i];
} else if (strcmp(arg, "output") == 0) {
output_file_name = argv[++i];
} else {
return usage(argv[0]);
}
} else {
if (!file) {
fprintf(stderr, "Error opening input file %s\n", arg);
return 1;
}
}
}
if (!output_file_name)
return usage(argv[0]);
struct GrooveTag *tag = NULL;
}
}
fprintf(stderr, "error attaching encoder\n");
return 1;
}
FILE *f = fopen(output_file_name, "wb");
if (!f) {
fprintf(stderr, "Error opening output file %s\n", output_file_name);
return 1;
}
fwrite(buffer->
data[0], 1, buffer->
size, f);
}
fclose(f);
while (item) {
}
return 0;
}