Changeset 08bd8e0
- Timestamp:
- Oct 15, 2013, 5:59:33 PM (11 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:
- d770fd2
- Parents:
- 3819aca
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/io/test-source_seek.c
r3819aca r08bd8e0 23 23 uint_t hop_size = 256; 24 24 uint_t n_frames = 0, read = 0; 25 uint_t old_n_frames ;25 uint_t old_n_frames_1, old_n_frames_2, old_n_frames_3; 26 26 if ( argc == 3 ) samplerate = atoi(argv[2]); 27 27 if ( argc == 4 ) hop_size = atoi(argv[3]); … … 42 42 } while ( read == hop_size ); 43 43 44 PRINT_MSG("read %d frames at %dHz (%d blocks) from %s\n", n_frames, samplerate, 45 n_frames / hop_size, source_path); 44 PRINT_MSG("read %.2fs, %d frames at %dHz (%d blocks) from %s\n", 45 n_frames * 1. / samplerate, 46 n_frames, samplerate, 47 n_frames / hop_size, source_path); 48 49 old_n_frames_1 = n_frames; 46 50 47 51 aubio_source_seek (s, 0); 48 49 old_n_frames = n_frames;50 52 51 53 n_frames = 0; … … 56 58 } while ( read == hop_size ); 57 59 58 PRINT_MSG("read %d frames at %dHz (%d blocks) from %s\n", n_frames, samplerate, 59 n_frames / hop_size, source_path); 60 PRINT_MSG("read %.2fs, %d frames at %dHz (%d blocks) from %s\n", 61 n_frames * 1. / samplerate, 62 n_frames, samplerate, 63 n_frames / hop_size, source_path); 64 65 old_n_frames_2 = n_frames; 66 67 aubio_source_seek (s, n_frames / 2); 68 69 n_frames = 0; 70 do { 71 aubio_source_do(s, vec, &read); 72 //fvec_print (vec); 73 n_frames += read; 74 } while ( read == hop_size ); 75 76 PRINT_MSG("read %.2fs, %d frames at %dHz (%d blocks) from %s\n", 77 n_frames * 1. / samplerate, 78 n_frames, samplerate, 79 n_frames / hop_size, source_path); 80 81 old_n_frames_3 = n_frames; 60 82 61 83 del_aubio_source (s); … … 63 85 del_fvec (vec); 64 86 65 assert ( n_frames == old_n_frames ); 87 assert ( old_n_frames_2 == old_n_frames_1 ); 88 assert ( old_n_frames_3 == (uint_t)floor(old_n_frames_1 / 2. + .5) ); 66 89 return err; 67 90 }
Note: See TracChangeset
for help on using the changeset viewer.