- Timestamp:
- Dec 19, 2018, 9:50:06 PM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/crepe, fix/ffmpeg5, master
- Children:
- 65628c4, 9630fa8
- Parents:
- eba24c59 (diff), f5adffe (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- tests/src
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/io/base-sink_custom.h
reba24c59 r5573a6b 26 26 char_t *sink_path = argv[2]; 27 27 28 aubio_source_t *src = NULL; 29 aubio_sink_custom_t *snk = NULL; 30 28 31 if ( argc >= 4 ) samplerate = atoi(argv[3]); 29 32 if ( argc >= 5 ) hop_size = atoi(argv[4]); 30 33 31 34 fvec_t *vec = new_fvec(hop_size); 35 if (!vec) { err = 1; goto failure; } 32 36 33 aubio_source_t *i = new_aubio_source(source_path, samplerate, hop_size); 34 if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(i); 37 src = new_aubio_source(source_path, samplerate, hop_size); 38 if (!src) { err = 1; goto failure; } 39 if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(src); 35 40 36 aubio_sink_custom_t *o = new_aubio_sink_custom(sink_path, samplerate); 37 38 if (!vec || !i || !o) { err = 1; goto failure; } 41 snk = new_aubio_sink_custom(sink_path, samplerate); 42 if (!snk) { err = 1; goto failure; } 39 43 40 44 do { 41 aubio_source_do( i, vec, &read);42 aubio_sink_custom_do( o, vec, read);45 aubio_source_do(src, vec, &read); 46 aubio_sink_custom_do(snk, vec, read); 43 47 n_frames += read; 44 48 } while ( read == hop_size ); … … 49 53 50 54 // close sink now (optional) 51 aubio_sink_custom_close( o);55 aubio_sink_custom_close(snk); 52 56 53 57 failure: 54 if ( o)55 del_aubio_sink_custom( o);56 if ( i)57 del_aubio_source( i);58 if (snk) 59 del_aubio_sink_custom(snk); 60 if (src) 61 del_aubio_source(src); 58 62 if (vec) 59 63 del_fvec(vec); -
tests/src/io/test-sink.c
reba24c59 r5573a6b 22 22 char_t *sink_path = argv[2]; 23 23 24 aubio_source_t *src = NULL; 25 aubio_sink_t *snk = NULL; 26 24 27 if ( argc >= 4 ) samplerate = atoi(argv[3]); 25 28 if ( argc >= 5 ) hop_size = atoi(argv[4]); 26 29 27 30 fvec_t *vec = new_fvec(hop_size); 31 if (!vec) { err = 1; goto failure; } 28 32 29 aubio_source_t *i = new_aubio_source(source_path, samplerate, hop_size); 30 if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(i); 33 src = new_aubio_source(source_path, samplerate, hop_size); 34 if (!src) { err = 1; goto failure; } 35 if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(src); 31 36 32 aubio_sink_t *o = new_aubio_sink(sink_path, samplerate); 33 34 if (!vec || !i || !o) { err = 1; goto failure; } 37 snk = new_aubio_sink(sink_path, samplerate); 38 if (!snk) { err = 1; goto failure; } 35 39 36 40 do { 37 aubio_source_do( i, vec, &read);38 aubio_sink_do( o, vec, read);41 aubio_source_do(src, vec, &read); 42 aubio_sink_do(snk, vec, read); 39 43 n_frames += read; 40 44 } while ( read == hop_size ); … … 45 49 46 50 // close sink now (optional) 47 aubio_sink_close( o);51 aubio_sink_close(snk); 48 52 49 53 failure: 50 if ( o)51 del_aubio_sink( o);52 if ( i)53 del_aubio_source( i);54 if (snk) 55 del_aubio_sink(snk); 56 if (src) 57 del_aubio_source(src); 54 58 if (vec) 55 59 del_fvec(vec); -
tests/src/onset/test-onset.c
reba24c59 r5573a6b 70 70 uint_t samplerate = 44100; 71 71 // hop_size < 1 72 if (new_aubio_onset("default", 5, 0, samplerate)) 73 return 1; 72 if (new_aubio_onset("default", 5, 0, samplerate)) return 1; 73 74 74 // buf_size < 2 75 if (new_aubio_onset("default", 1, 1, samplerate)) 76 return 1; 75 if (new_aubio_onset("default", 1, 1, samplerate)) return 1; 76 77 77 // buf_size < hop_size 78 if (new_aubio_onset("default", hop_size, win_size, samplerate)) 79 return 1; 78 if (new_aubio_onset("default", hop_size, win_size, samplerate)) return 1; 79 80 80 // samplerate < 1 81 if (new_aubio_onset("default", 1024, 512, 0)) 82 return 1; 81 if (new_aubio_onset("default", 1024, 512, 0)) return 1; 83 82 84 83 // specdesc creation failed 85 if (new_aubio_onset("abcd", win_size, win_size/2, samplerate)) 86 return 1; 84 if (new_aubio_onset("abcd", win_size, win_size/2, samplerate)) return 1; 87 85 88 86 aubio_onset_t *o; … … 93 91 94 92 o = new_aubio_onset("default", win_size, hop_size, samplerate); 95 if (!aubio_onset_set_default_parameters(o, "wrong_type")) 96 return 1; 93 if (!aubio_onset_set_default_parameters(o, "wrong_type")) return 1; 97 94 del_aubio_onset(o); 98 95 -
tests/src/tempo/test-tempo.c
reba24c59 r5573a6b 82 82 83 83 // test wrong method fails 84 if (new_aubio_tempo("unexisting_method", win_size, hop_size, samplerate)) 85 return 1; 84 if (new_aubio_tempo("undefined", win_size, hop_size, samplerate)) return 1; 86 85 87 86 // test hop > win fails 88 if (new_aubio_tempo("default", hop_size, win_size, samplerate)) 89 return 1; 87 if (new_aubio_tempo("default", hop_size, win_size, samplerate)) return 1; 90 88 91 89 // test null hop_size fails 92 if (new_aubio_tempo("default", win_size, 0, samplerate)) 93 return 1; 90 if (new_aubio_tempo("default", win_size, 0, samplerate)) return 1; 94 91 95 92 // test 1 buf_size fails 96 if (new_aubio_tempo("default", 1, 1, samplerate)) 97 return 1; 93 if (new_aubio_tempo("default", 1, 1, samplerate)) return 1; 98 94 99 95 // test null samplerate fails 100 if (new_aubio_tempo("default", win_size, hop_size, 0)) 101 return 1; 96 if (new_aubio_tempo("default", win_size, hop_size, 0)) return 1; 102 97 103 98 // test short sizes workaround 104 99 t = new_aubio_tempo("default", 2048, 2048, 500); 105 if (!t) 106 return 1; 100 if (!t) return 1; 107 101 108 102 del_aubio_tempo(t); 109 103 110 104 t = new_aubio_tempo("default", win_size, hop_size, samplerate); 111 if (!t) 112 return 1; 105 if (!t) return 1; 113 106 114 107 in = new_fvec(hop_size); -
tests/src/temporal/test-filter.c
reba24c59 r5573a6b 10 10 aubio_filter_t *o = new_aubio_filter_c_weighting (44100); 11 11 12 if (new_aubio_filter(0)) 13 return 1; 12 if (new_aubio_filter(0)) return 1; 14 13 15 if (aubio_filter_get_samplerate(o) != 44100) 16 return 1; 14 if (aubio_filter_get_samplerate(o) != 44100) return 1; 17 15 18 if (aubio_filter_set_c_weighting (o, -1) == 0) 19 return 1; 16 if (aubio_filter_set_c_weighting (o, -1) == 0) return 1; 20 17 21 if (aubio_filter_set_c_weighting (0, 32000) == 0) 22 return 1; 18 if (aubio_filter_set_c_weighting (0, 32000) == 0) return 1; 23 19 24 20 in->data[impulse_at] = 0.5; … … 30 26 o = new_aubio_filter_a_weighting (32000); 31 27 32 if (aubio_filter_set_a_weighting (o, -1) == 0) 33 return 1; 34 if (aubio_filter_set_a_weighting (0, 32000) == 0) 35 return 1; 28 if (aubio_filter_set_a_weighting (o, -1) == 0) return 1; 29 30 if (aubio_filter_set_a_weighting (0, 32000) == 0) return 1; 36 31 37 32 in->data[impulse_at] = 0.5;
Note: See TracChangeset
for help on using the changeset viewer.