From d91c31bcc7378887c0d247f196d32ffe6db65935 Mon Sep 17 00:00:00 2001 From: stefonzo Date: Thu, 8 Sep 2022 21:36:50 -0500 Subject: add libwav experiment code --- src/load/load-wav.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/load/load-wav.c (limited to 'src/load/load-wav.c') diff --git a/src/load/load-wav.c b/src/load/load-wav.c new file mode 100644 index 0000000..4d94b9c --- /dev/null +++ b/src/load/load-wav.c @@ -0,0 +1,20 @@ +#include +#include +#include "load.h" +#include + +struct mossrose_sound_t * load_wav(const char *filename) +{ + WavFile *audio = wav_open(filename, "r"); + if (audio == NULL) { + fprintf(stderr, "Couldn't open wav file.\n"); + return NULL; + } + + printf("N of Channels: %d\nSample Rate: %d\nSample Size: %d\n" + "Length: %d\n" + "Sub format: %d\n", wav_get_num_channels(audio), wav_get_sample_rate(audio), + wav_get_sample_size(audio), wav_get_length(audio), wav_get_sub_format(audio)); + wav_close(audio); + return NULL; +} -- cgit v1.2.1