summaryrefslogtreecommitdiff
path: root/src/load/load-wav.c
blob: 4d94b9c473c1ea273eccbf23802dff0a7e41ab94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;
}