-static ssize_t wav_convert(char *inbuf, size_t len, struct filter_node *fn)
-{
- size_t copy;
- int *bof = fn->private_data;
-
- if (*bof) {
- if (!len)
- return 0;
- if (!fn->fc->channels || !fn->fc->samplerate) {
- PARA_ERROR_LOG("%s\n", para_strerror(E_WAV_BAD_FC));
- return -E_WAV_BAD_FC;
- }
- make_wav_header(fn->fc->channels, fn->fc->samplerate, fn->buf);
- fn->loaded = WAV_HEADER_LEN;
- *bof = 0;
-// return 0;
- }
- copy = PARA_MIN(len, fn->bufsize - fn->loaded);
- memmove(fn->buf + fn->loaded, inbuf, copy);
- fn->loaded += copy;
-// PARA_DEBUG_LOG("len = %d, copy = %d\n", len, copy);
- return copy;
-}
-