Changeset 385a06e2 for src


Ignore:
Timestamp:
Sep 5, 2015, 11:49:08 AM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
aba718a
Parents:
a65d37a
Message:

src/io/sink_sndfile.c: fix for double precision

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink_sndfile.c

    ra65d37a r385a06e2  
    3333#define MAX_CHANNELS 6
    3434#define MAX_SIZE 4096
     35
     36#if !HAVE_AUBIO_DOUBLE
     37#define aubio_sf_write_smpl sf_write_float
     38#else /* HAVE_AUBIO_DOUBLE */
     39#define aubio_sf_write_smpl sf_write_double
     40#endif /* HAVE_AUBIO_DOUBLE */
    3541
    3642struct _aubio_sink_sndfile_t {
     
    135141    return AUBIO_FAIL;
    136142  }
    137   s->scratch_data = AUBIO_ARRAY(float,s->scratch_size);
     143  s->scratch_data = AUBIO_ARRAY(smpl_t,s->scratch_size);
    138144
    139145  return AUBIO_OK;
     
    162168  }
    163169
    164   written_frames = sf_write_float (s->handle, s->scratch_data, nsamples);
     170  written_frames = aubio_sf_write_smpl (s->handle, s->scratch_data, nsamples);
    165171  if (written_frames/channels != write) {
    166172    AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written\n",
     
    192198  }
    193199
    194   written_frames = sf_write_float (s->handle, s->scratch_data, nsamples);
     200  written_frames = aubio_sf_write_smpl (s->handle, s->scratch_data, nsamples);
    195201  if (written_frames/channels != write) {
    196202    AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written\n",
Note: See TracChangeset for help on using the changeset viewer.