- Timestamp:
- Sep 20, 2014, 3:26:13 PM (10 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:
- ffc1f79
- Parents:
- 9657163
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/sink_sndfile.c
r9657163 rad1ba08 142 142 void aubio_sink_sndfile_do(aubio_sink_sndfile_t *s, fvec_t * write_data, uint_t write){ 143 143 uint_t i, j, channels = s->channels; 144 int nsamples = channels*write;144 int nsamples = 0; 145 145 smpl_t *pwrite; 146 146 sf_count_t written_frames; 147 147 148 148 if (write > s->max_size) { 149 AUBIO_WRN(" trying to write %d frames, but only %d can be written at a time",149 AUBIO_WRN("sink_sndfile: trying to write %d frames, but only %d can be written at a time\n", 150 150 write, s->max_size); 151 151 write = s->max_size; 152 152 } 153 154 nsamples = channels * write; 153 155 154 156 /* interleaving data */ … … 162 164 written_frames = sf_write_float (s->handle, s->scratch_data, nsamples); 163 165 if (written_frames/channels != write) { 164 AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written ",166 AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written\n", 165 167 write, s->path, (uint_t)written_frames); 166 168 } … … 170 172 void aubio_sink_sndfile_do_multi(aubio_sink_sndfile_t *s, fmat_t * write_data, uint_t write){ 171 173 uint_t i, j, channels = s->channels; 172 int nsamples = channels*write;174 int nsamples = 0; 173 175 smpl_t *pwrite; 174 176 sf_count_t written_frames; 175 177 176 178 if (write > s->max_size) { 177 AUBIO_WRN(" trying to write %d frames, but only %d can be written at a time",179 AUBIO_WRN("sink_sndfile: trying to write %d frames, but only %d can be written at a time\n", 178 180 write, s->max_size); 179 181 write = s->max_size; 180 182 } 183 184 nsamples = channels * write; 181 185 182 186 /* interleaving data */ … … 190 194 written_frames = sf_write_float (s->handle, s->scratch_data, nsamples); 191 195 if (written_frames/channels != write) { 192 AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written ",196 AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written\n", 193 197 write, s->path, (uint_t)written_frames); 194 198 }
Note: See TracChangeset
for help on using the changeset viewer.