Index: example-clients/capture_client.c =================================================================== RCS file: /cvsroot/jackit/jack/example-clients/capture_client.c,v retrieving revision 1.1 diff -u -r1.1 capture_client.c --- example-clients/capture_client.c 16 May 2002 01:16:57 -0000 1.1 +++ example-clients/capture_client.c 26 Jun 2002 10:39:21 -0000 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -155,7 +156,7 @@ } } - if (sf_writef_double (info->sf, fbuf, buf->nframes, 1) != buf->nframes) { + if (sf_writef_double (info->sf, fbuf, buf->nframes) != buf->nframes) { char errstr[256]; sf_error_str (0, errstr, sizeof (errstr) - 1); fprintf (stderr, "cannot write data to sndfile (%s)\n", errstr); @@ -233,10 +234,24 @@ sf_info.samplerate = jack_get_sample_rate (info->client); sf_info.channels = info->channels; - sf_info.format = SF_FORMAT_WAV|SF_FORMAT_PCM; - sf_info.pcmbitwidth = info->bitdepth; + sf_info.format = SF_FORMAT_WAV; + switch (info->bitdepth) { + case 8: + sf_info.format |= SF_FORMAT_PCM_U8; + break; + case 24: + sf_info.format |= SF_FORMAT_PCM_24; + break; + case 32: + sf_info.format |= SF_FORMAT_PCM_32; + break; + case 16: + default: + sf_info.format |= SF_FORMAT_PCM_16; + break; + } - if ((info->sf = sf_open_write (info->path, &sf_info)) == NULL) { + if ((info->sf = sf_open (info->path, SFM_WRITE, &sf_info)) == NULL) { char errstr[256]; sf_error_str (0, errstr, sizeof (errstr) - 1); fprintf (stderr, "cannot open sndfile \"%s\" for output (%s)\n", info->path, errstr);