#define MAX_CHANNELS 6
#define MAX_SIZE 4096
+#if !HAVE_AUBIO_DOUBLE
+#define aubio_sf_write_smpl sf_write_float
+#else /* HAVE_AUBIO_DOUBLE */
+#define aubio_sf_write_smpl sf_write_double
+#endif /* HAVE_AUBIO_DOUBLE */
+
struct _aubio_sink_sndfile_t {
uint_t samplerate;
uint_t channels;
s->max_size, s->channels, MAX_CHANNELS * MAX_CHANNELS);
return AUBIO_FAIL;
}
- s->scratch_data = AUBIO_ARRAY(float,s->scratch_size);
+ s->scratch_data = AUBIO_ARRAY(smpl_t,s->scratch_size);
return AUBIO_OK;
}
}
}
- written_frames = sf_write_float (s->handle, s->scratch_data, nsamples);
+ written_frames = aubio_sf_write_smpl (s->handle, s->scratch_data, nsamples);
if (written_frames/channels != write) {
AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written\n",
write, s->path, (uint_t)written_frames);
}
}
- written_frames = sf_write_float (s->handle, s->scratch_data, nsamples);
+ written_frames = aubio_sf_write_smpl (s->handle, s->scratch_data, nsamples);
if (written_frames/channels != write) {
AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written\n",
write, s->path, (uint_t)written_frames);