Changeset 695e171 for src/io/sink_sndfile.c
- Timestamp:
- Sep 6, 2015, 10:40:14 AM (9 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler
- Children:
- 3d30b90
- Parents:
- 65c352e (diff), 827267b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/sink_sndfile.c
r65c352e r695e171 33 33 #define MAX_CHANNELS 6 34 34 #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 */ 35 41 36 42 struct _aubio_sink_sndfile_t { … … 126 132 AUBIO_ERR("sink_sndfile: Failed opening %s. %s\n", s->path, sf_strerror (NULL)); 127 133 return AUBIO_FAIL; 128 } 134 } 129 135 130 136 s->scratch_size = s->max_size*s->channels; … … 135 141 return AUBIO_FAIL; 136 142 } 137 s->scratch_data = AUBIO_ARRAY( float,s->scratch_size);143 s->scratch_data = AUBIO_ARRAY(smpl_t,s->scratch_size); 138 144 139 145 return AUBIO_OK; … … 141 147 142 148 void aubio_sink_sndfile_do(aubio_sink_sndfile_t *s, fvec_t * write_data, uint_t write){ 143 uint_t i, j, 149 uint_t i, j, channels = s->channels; 144 150 int nsamples = 0; 145 151 smpl_t *pwrite; … … 162 168 } 163 169 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); 165 171 if (written_frames/channels != write) { 166 172 AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written\n", … … 171 177 172 178 void aubio_sink_sndfile_do_multi(aubio_sink_sndfile_t *s, fmat_t * write_data, uint_t write){ 173 uint_t i, j, 179 uint_t i, j, channels = s->channels; 174 180 int nsamples = 0; 175 181 smpl_t *pwrite; … … 192 198 } 193 199 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); 195 201 if (written_frames/channels != write) { 196 202 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.