diff options
author | stefonzo <stevester.robinson@gmail.com> | 2022-09-08 21:36:50 -0500 |
---|---|---|
committer | stefonzo <stevester.robinson@gmail.com> | 2022-09-08 21:36:50 -0500 |
commit | d91c31bcc7378887c0d247f196d32ffe6db65935 (patch) | |
tree | 0c00095baff013db6190f90f417e270d67959881 /src | |
parent | 72cd969bdad28b8bc6094a1503a774005b6f1257 (diff) |
add libwav experiment code
Diffstat (limited to 'src')
-rw-r--r-- | src/load/load-wav.c | 20 |
1 files changed, 20 insertions, 0 deletions
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 <stdio.h> +#include <wav.h> +#include "load.h" +#include <mossrose.h> + +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; +} |