Changeset c6e7ba1
- Timestamp:
- Apr 25, 2016, 4:42:43 PM (9 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:
- b4e1438
- Parents:
- b60f297
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/io/source_sndfile.c
rb60f297 rc6e7ba1 54 54 int input_channels; 55 55 int input_format; 56 int duration; 56 57 57 58 // resampling stuff … … 106 107 s->input_channels = sfinfo.channels; 107 108 s->input_format = sfinfo.format; 109 s->duration = sfinfo.frames; 108 110 109 111 if (samplerate == 0) { … … 273 275 } 274 276 277 uint_t aubio_source_sndfile_get_duration (const aubio_source_sndfile_t * s) { 278 if (s && s->duration) { 279 return s->duration; 280 } 281 return 0; 282 } 283 275 284 uint_t aubio_source_sndfile_seek (aubio_source_sndfile_t * s, uint_t pos) { 276 285 uint_t resampled_pos = (uint_t)ROUND(pos / s->ratio); -
src/io/source_sndfile.h
rb60f297 rc6e7ba1 121 121 /** 122 122 123 get the duration of source object, in frames 124 125 \param s source object, created with ::new_aubio_source_sndfile 126 \return number of frames in file 127 128 */ 129 uint_t aubio_source_sndfile_get_duration (const aubio_source_sndfile_t *s); 130 131 /** 132 123 133 close source 124 134 -
tests/src/io/test-source_sndfile.c
rb60f297 rc6e7ba1 39 39 fvec_t *vec = new_fvec(hop_size); 40 40 41 uint_t n_frames_expected = aubio_source_sndfile_get_duration(s); 42 41 43 samplerate = aubio_source_sndfile_get_samplerate(s); 42 44 … … 47 49 } while ( read == hop_size ); 48 50 49 PRINT_MSG("read %d frames at %dHz (%d blocks) from %s\n", n_frames, samplerate, 50 n_frames / hop_size, source_path); 51 PRINT_MSG("read %d frames (expected %d) at %dHz (%d blocks) from %s\n", 52 n_frames, n_frames_expected, samplerate, n_frames / hop_size, 53 source_path); 51 54 52 55 del_fvec (vec);
Note: See TracChangeset
for help on using the changeset viewer.