int bytespersec = channels * samplerate * BITS / 8;
int align = channels * BITS / 8;
+ assert(channels);
PARA_DEBUG_LOG("writing wave header: %d channels, %d KHz\n", channels, samplerate);
memset(headbuf, 0, WAV_HEADER_LEN);
memcpy(headbuf, "RIFF", 4);
int *bof = fn->private_data;
if (*bof) {
+ if (!len)
+ return 0;
make_wav_header(fn->fc->channels, fn->fc->samplerate, fn);
fn->loaded = WAV_HEADER_LEN;
*bof = 0;