Changeset 37d0a0c for src/io/source_wavread.c
- Timestamp:
- Nov 28, 2016, 3:13:19 PM (8 years ago)
- Branches:
- sampler
- Children:
- 6f440b3
- Parents:
- 0840440
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/source_wavread.c
r0840440 r37d0a0c 110 110 buf[4] = '\0'; 111 111 if ( strcmp((const char *)buf, "RIFF") != 0 ) { 112 AUBIO_ERR("source_wavread: could not find RIFF header in %s\n", s->path);112 AUBIO_ERR("source_wavread: Failed opening %s (could not find RIFF header)\n", s->path); 113 113 goto beach; 114 114 } … … 121 121 buf[4] = '\0'; 122 122 if ( strcmp((const char *)buf, "WAVE") != 0 ) { 123 AUBIO_ERR("source_wavread: wrong format in RIFF header in %s\n", s->path);123 AUBIO_ERR("source_wavread: Failed opening %s (wrong format in RIFF header)\n", s->path); 124 124 goto beach; 125 125 } … … 135 135 bytes_junk += read_little_endian(buf, 4); 136 136 if (fseek(s->fid, bytes_read + bytes_junk, SEEK_SET) != 0) { 137 AUBIO_ERR("source_wavread: could not seek past JUNK Chunk in %s (%s)\n",137 AUBIO_ERR("source_wavread: Failed opening %s (could not seek past JUNK Chunk: %s)\n", 138 138 s->path, strerror(errno)); 139 139 goto beach; … … 148 148 // get the fmt chunk 149 149 if ( strcmp((const char *)buf, "fmt ") != 0 ) { 150 AUBIO_ERR("source_wavread: failed finding fmt RIFF header in %s\n", s->path);150 AUBIO_ERR("source_wavread: Failed opening %s (could not find 'fmt ' in RIFF header)\n", s->path); 151 151 goto beach; 152 152 } … … 157 157 if ( format != 16 ) { 158 158 // TODO accept format 18 159 AUBIO_ERR("source_wavread: file %s is not encoded with PCM\n", s->path);159 AUBIO_ERR("source_wavread: Failed opening %s (not encoded with PCM)\n", s->path); 160 160 goto beach; 161 161 } 162 162 if ( buf[1] || buf[2] | buf[3] ) { 163 AUBIO_ERR("source_wavread: Subchunk1Size should be 0, in %s\n", s->path);163 AUBIO_ERR("source_wavread: Failed opening %s (Subchunk1Size should be 0)\n", s->path); 164 164 goto beach; 165 165 } … … 168 168 bytes_read += fread(buf, 1, 2, s->fid); 169 169 if ( buf[0] != 1 || buf[1] != 0) { 170 AUBIO_ERR("source_wavread: AudioFormat should be PCM, in %s\n", s->path);170 AUBIO_ERR("source_wavread: Failed opening %s (AudioFormat should be PCM)\n", s->path); 171 171 goto beach; 172 172 } … … 200 200 201 201 if ( byterate * 8 != sr * channels * bitspersample ) { 202 AUBIO_ERR("source_wavread: wrong byterate in %s\n", s->path);202 AUBIO_ERR("source_wavread: Failed opening %s (wrong byterate)\n", s->path); 203 203 goto beach; 204 204 } 205 205 206 206 if ( blockalign * 8 != channels * bitspersample ) { 207 AUBIO_ERR("source_wavread: wrong blockalign in %s\n", s->path);207 AUBIO_ERR("source_wavread: Failed opening %s (wrong blockalign)\n", s->path); 208 208 goto beach; 209 209 }
Note: See TracChangeset
for help on using the changeset viewer.