/* rw_wav.h read and write .wav files not working for all .wav files */ typedef struct { char riff[4]; int fsize; char wave[4]; char fmt[4]; int nbytes; short ccode; short channels; int rate; int avgrate; short blockalign; short bps; /* bits per sample */ char data[4]; int csize; char more[4]; } header; void read_wave(char* file_name, header *w, char sound[]); /* modify header if you know what you are doing */ void write_wave(char* file_name, header w, char sound[]); /* may need to rescale into -127 .. 127 */ void rescale(int n, float zn[]);