Changeset a2b7187 for src/io/sink_wavwrite.c
- Timestamp:
- Dec 20, 2018, 5:30:33 PM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
- Children:
- f5a97ed
- Parents:
- 14a5b9a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/sink_wavwrite.c
r14a5b9a ra2b7187 239 239 } 240 240 241 static 242 void aubio_sink_wavwrite_write_frames(aubio_sink_wavwrite_t *s, uint_t write) 243 { 244 uint_t written_frames = 0; 245 246 written_frames = fwrite(s->scratch_data, 2 * s->channels, write, s->fid); 247 248 if (written_frames != write) { 249 char errorstr[256]; 250 AUBIO_STRERROR(errno, errorstr, sizeof(errorstr)); 251 AUBIO_WRN("sink_wavwrite: trying to write %d frames to %s, but only %d" 252 " could be written (%s)\n", write, s->path, written_frames, errorstr); 253 } 254 s->total_frames_written += written_frames; 255 } 241 256 242 257 void aubio_sink_wavwrite_do(aubio_sink_wavwrite_t *s, fvec_t * write_data, uint_t write){ 243 uint_t c = 0, i = 0 , written_frames = 0;258 uint_t c = 0, i = 0; 244 259 uint_t length = aubio_sink_validate_input_length("sink_wavwrite", s->path, 245 260 s->max_size, write_data->length, write); … … 250 265 } 251 266 } 252 written_frames = fwrite(s->scratch_data, 2, length * s->channels, s->fid); 253 254 if (written_frames != write) { 255 AUBIO_WRN("sink_wavwrite: trying to write %d frames to %s, " 256 "but only %d could be written\n", write, s->path, written_frames); 257 } 258 s->total_frames_written += written_frames; 259 return; 267 268 aubio_sink_wavwrite_write_frames(s, length); 260 269 } 261 270 262 271 void aubio_sink_wavwrite_do_multi(aubio_sink_wavwrite_t *s, fmat_t * write_data, uint_t write){ 263 uint_t c = 0, i = 0 , written_frames = 0;272 uint_t c = 0, i = 0; 264 273 265 274 uint_t channels = aubio_sink_validate_input_channels("sink_wavwrite", s->path, … … 273 282 } 274 283 } 275 written_frames = fwrite(s->scratch_data, 2, length * s->channels, s->fid); 276 277 if (written_frames != write * s->channels) { 278 AUBIO_WRN("sink_wavwrite: trying to write %d frames to %s, " 279 "but only %d could be written\n", write, s->path, written_frames / s->channels); 280 } 281 s->total_frames_written += written_frames; 282 return; 284 285 aubio_sink_wavwrite_write_frames(s, length); 283 286 } 284 287
Note: See TracChangeset
for help on using the changeset viewer.