Changeset 5573a6b for tests/src/io
- 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/io
- Files:
-
- 2 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);
Note: See TracChangeset
for help on using the changeset viewer.