2016-01-27 15:42:15 +00:00
|
|
|
#ifndef WAV_H
|
|
|
|
#define WAV_H
|
2015-01-24 08:44:57 +00:00
|
|
|
|
2016-01-24 13:59:14 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2015-01-26 03:04:27 +00:00
|
|
|
#include "../types.h"
|
2015-01-24 08:44:57 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char chunkId[4];
|
|
|
|
u32 chunkSize;
|
|
|
|
char format[4];
|
|
|
|
} Riff;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char chunkId[4];
|
|
|
|
u32 chunkSize;
|
|
|
|
u16 format;
|
|
|
|
u16 numChannels;
|
|
|
|
u32 sampleRate;
|
|
|
|
u32 byteRate;
|
|
|
|
u16 align;
|
|
|
|
u16 bitsPerSample;
|
|
|
|
} Format;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char chunkId[4];
|
|
|
|
u32 chunkSize;
|
2015-01-26 03:04:27 +00:00
|
|
|
u8* data;
|
2015-01-24 08:44:57 +00:00
|
|
|
} Data;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
Riff riff;
|
|
|
|
Format format;
|
|
|
|
Data data;
|
|
|
|
} WAV;
|
|
|
|
|
2016-01-24 13:59:14 +00:00
|
|
|
WAV* wav_read(FILE* fd);
|
2015-01-26 03:04:27 +00:00
|
|
|
void wav_free(WAV* wav);
|
2015-01-24 08:44:57 +00:00
|
|
|
|
|
|
|
#endif
|