Changeset b03f1bf
- Timestamp:
- Dec 23, 2018, 12:09:31 AM (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:
- 0a1ad90
- Parents:
- 26bd5e0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/sink_wavwrite.c
r26bd5e0 rb03f1bf 28 28 #include "io/sink_wavwrite.h" 29 29 #include "io/ioutils.h" 30 31 #include <errno.h>32 30 33 31 #define MAX_SIZE 4096 … … 168 166 s->fid = fopen((const char *)s->path, "wb"); 169 167 if (!s->fid) { 170 char errorstr[256]; 171 AUBIO_STRERROR(errno, errorstr, sizeof(errorstr)); 172 AUBIO_ERR("sink_wavwrite: could not open %s (%s)\n", s->path, errorstr); 168 AUBIO_STRERR("sink_wavwrite: could not open %s (%s)\n", s->path, errorstr); 173 169 goto beach; 174 170 } … … 217 213 // fwrite(*, *, 1, s->fid) was called 13 times, check success 218 214 if (written != 13) { 219 char errorstr[256]; 220 AUBIO_STRERROR(errno, errorstr, sizeof(errorstr)); 221 AUBIO_WRN("sink_wavwrite: writing header to %s failed, expected %d" 215 AUBIO_STRERR("sink_wavwrite: writing header to %s failed, expected %d" 222 216 " write but got only %d (%s)\n", s->path, 13, written, errorstr); 223 217 return AUBIO_FAIL; … … 247 241 248 242 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" 243 AUBIO_STRERR("sink_wavwrite: trying to write %d frames to %s, but only %d" 252 244 " could be written (%s)\n", write, s->path, written_frames, errorstr); 253 245 } … … 298 290 written += fwrite(write_little_endian(data_size, buf, 4), 4, 1, s->fid); 299 291 if (written != 2 || err != 0) { 300 char errorstr[256]; 301 AUBIO_STRERROR(errno, errorstr, sizeof(errorstr)); 302 AUBIO_WRN("sink_wavwrite: updating header of %s failed, expected %d" 292 AUBIO_STRERR("sink_wavwrite: updating header of %s failed, expected %d" 303 293 " write but got only %d (%s)\n", s->path, 2, written, errorstr); 304 294 } 305 295 // close file 306 296 if (fclose(s->fid)) { 307 char errorstr[256]; 308 AUBIO_STRERROR(errno, errorstr, sizeof(errorstr)); 309 AUBIO_ERR("sink_wavwrite: Error closing file %s (%s)\n", s->path, errorstr); 297 AUBIO_STRERR("sink_wavwrite: Error closing file %s (%s)\n", s->path, errorstr); 310 298 } 311 299 s->fid = NULL;
Note: See TracChangeset
for help on using the changeset viewer.