
#include <stdio.h>

#include "datatypes.h"


#define SAMPLE_END_BYTES 256

// max. size of total sampledata
#define MAX_SAMPLESIZE 2621440



int load_WAV_header(char *WAVfname);
int load_and_convert_WAV(char *WAVfname);

u32 readID(u8 *ptr);
u32 read32(u8 *ptr);

s32 read16(s8 *ptr);

void write32(u8 *ptr,u32 value);


extern int WAVsize, RIFFsize;

extern int file_format_tag;
extern int file_channels;
extern int file_sample_rate;
extern int file_bytes_second;
extern int file_block_align;
extern int file_bits_sample;
extern int file_data_length;

extern int num_samples;

extern int normalise_samples;

extern u8 *template_ptr;

extern int sample_bytes_total;

extern u8 *samples_start;
extern u32 sample_list;
extern u32 sample_list_names;
extern u32 sample_data;

