Changeset 2eccf22
- Timestamp:
- Feb 23, 2014, 5:29:42 PM (11 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, pitchshift, sampler, timestretch, yinfft+
- Children:
- 18d8bef
- Parents:
- 4ed4b1f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/sink_sndfile.c
r4ed4b1f r2eccf22 27 27 28 28 #include "aubio_priv.h" 29 #include "sink_sndfile.h"30 29 #include "fvec.h" 30 #include "fmat.h" 31 #include "io/sink_sndfile.h" 31 32 32 33 #define MAX_CHANNELS 6 … … 167 168 } 168 169 170 void aubio_sink_sndfile_do_multi(aubio_sink_sndfile_t *s, fmat_t * write_data, uint_t write){ 171 uint_t i, j, channels = s->channels; 172 int nsamples = channels*write; 173 smpl_t *pwrite; 174 sf_count_t written_frames; 175 176 if (write > s->max_size) { 177 AUBIO_WRN("trying to write %d frames, but only %d can be written at a time", 178 write, s->max_size); 179 write = s->max_size; 180 } 181 182 /* interleaving data */ 183 for ( i = 0; i < write_data->height; i++) { 184 pwrite = (smpl_t *)write_data->data[i]; 185 for (j = 0; j < write; j++) { 186 s->scratch_data[channels*j+i] = pwrite[j]; 187 } 188 } 189 190 written_frames = sf_write_float (s->handle, s->scratch_data, nsamples); 191 if (written_frames/channels != write) { 192 AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written", 193 write, s->path, (uint_t)written_frames); 194 } 195 return; 196 } 197 169 198 uint_t aubio_sink_sndfile_close (aubio_sink_sndfile_t *s) { 170 199 if (!s->handle) {
Note: See TracChangeset
for help on using the changeset viewer.