#ifndef _Format_WAVE_H
#define _Format_WAVE_H

#include "inttypes.h"

/*-----------------
 * RIFFwave header
 */

typedef union
{
  char	c[4];
  int32_t i;
} tag_t;

typedef struct
{
  tag_t   riff;
  int32_t size;
  tag_t   tag;
  // wave specific
  tag_t   fmt;
  int32_t fmtsize;
  int16_t format;
  int16_t channels;
  int32_t samplerate;
  int32_t bytespersec;
  int16_t blocksize;
  int16_t bitspersample;
} wave_t;

static const tag_t TagRIFF = {{'R','I','F','F'}};
static const tag_t TagWAVE = {{'W','A','V','E'}};
static const tag_t Tagfmt  = {{'f','m','t',' '}};
static const tag_t Tagdata = {{'d','a','t','a'}};

#endif
