#include #include #include #include #include #include #include #include static void usage(int argc, char **argv, const char *message, ...) { va_list args; va_start(args, message); if (message) { vfprintf(stderr, message, args); fputc('\n', stderr); } va_end(args); fprintf(stderr, "usage: %s file.wav\n", argv[0]); exit(EX_USAGE); } int main(int argc, char **argv) { xas_audio_stream *wave; if (argc != 2) { usage(argc, argv, "No input file provided"); } if ((wave = xas_riff_open_file(argv[1], O_RDONLY)) == NULL) { goto error_riff_open_file; } printf("channels %zu sample rate %zu sample size %zu\n", wave->channels, wave->sample_rate, wave->sample_size); xas_audio_stream_destroy(wave); return EX_OK; error_riff_open_file: return EX_OSERR; }