--- np2/common/wavefile.h 2003/10/16 17:57:16 1.1 +++ np2/common/wavefile.h 2003/11/28 08:01:32 1.2 @@ -30,22 +30,30 @@ typedef struct { } 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 { - UINT rate; - UINT channels; - UINT bit; - - 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); + long fh; + UINT rate; + UINT bits; + UINT ch; + UINT size; + + BYTE *ptr; + UINT remain; + BYTE buf[4096]; +} _WAVEWR, *WAVEWR; + + +#ifdef __cplusplus +extern "C" { +#endif + +WAVEWR wavewr_open(const char *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