PARA_DEBUG_LOG("writing wave header: %d channels, %d KHz\n", channels, samplerate);
memset(headbuf, 0, WAV_HEADER_LEN);
memcpy(headbuf, "RIFF", 4);
write_u32(headbuf + 4, size - 8);
memcpy(headbuf + 8, "WAVE", 4);
memcpy(headbuf + 12, "fmt ", 4);
PARA_DEBUG_LOG("writing wave header: %d channels, %d KHz\n", channels, samplerate);
memset(headbuf, 0, WAV_HEADER_LEN);
memcpy(headbuf, "RIFF", 4);
write_u32(headbuf + 4, size - 8);
memcpy(headbuf + 8, "WAVE", 4);
memcpy(headbuf + 12, "fmt ", 4);