#ifndef WAV_H
#define WAV_H

#include "integer.h"
#include "types.h"
#include "p33FJ64GP802.h"

typedef struct
{
	unsigned long riff;				// 4
	unsigned long chunkSize;		// 4
	unsigned long format;			// 4
	unsigned long subChunk1ID;		// 4
	unsigned long subChunk1Size;	// 4
	unsigned int audioFormat;		// 2
	unsigned int numChannels;		// 2
	unsigned long sampleRate;		// 4
	unsigned long byteRate;			// 4
	unsigned int blockAlign;		// 2
	unsigned int bitsPerSample;		// 2
	unsigned long subChunk2ID;		// 4
	unsigned long subChunk2Size;	// 4
} WAVHeader;

void readWAVHeader(WAVHeader*, BYTE*);
void writeWAVHeader(WAVHeader*, BYTE*);
void fillWAVHeader(WAVHeader*);

#endif
