--- np2/common/wavefile.h 2003/10/16 17:57:16 1.1.1.1 +++ np2/common/wavefile.h 2005/02/09 20:11:34 1.4 @@ -11,41 +11,49 @@ typedef struct { UINT32 sig; - BYTE size[4]; + UINT8 size[4]; UINT32 fmt; } RIFF_HEADER; typedef struct { UINT sig; - BYTE size[4]; + UINT8 size[4]; } WAVE_HEADER; typedef struct { - BYTE format[2]; - BYTE channel[2]; - BYTE rate[4]; - BYTE rps[4]; - BYTE block[2]; - BYTE bit[2]; + UINT8 format[2]; + UINT8 channel[2]; + UINT8 rate[4]; + UINT8 rps[4]; + UINT8 block[2]; + UINT8 bit[2]; } WAVE_INFOS; -#if 0 -typedef long (*WFSEEK)(void *fh, long pos, int method); -typedef UINT (*WFREAD)(void *fh, void *buf, UINT size); +// ---- write typedef struct { + long fh; UINT rate; - UINT channels; - UINT bit; + UINT bits; + UINT ch; + UINT size; + + UINT8 *ptr; + UINT remain; + UINT8 buf[4096]; +} _WAVEWR, *WAVEWR; - void *fh; - WFREAD read; - WFSEEK seek; -} _WAVHDL, *WAVHDL; - -WAVHDL wavhdl_create(void *fh, WFSEEK seek, WFREAD read); -void wavhdl_destroy(WAVHDL hdl); -UINT wavhdl_getpcm(WAVHDL hdl, void *buf, UINT size); + +#ifdef __cplusplus +extern "C" { +#endif + +WAVEWR wavewr_open(const OEMCHAR *filename, UINT rate, UINT bits, UINT ch); +UINT wavewr_write(WAVEWR hdl, const void *buf, UINT size); +void wavewr_close(WAVEWR hdl); + +#ifdef __cplusplus +} #endif