Changeset 65628c4 for tests/src/io/test-sink.c
- Timestamp:
- Dec 19, 2018, 9:50:33 PM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/crepe, fix/ffmpeg5, master
- Children:
- f56f795
- Parents:
- d64f56d (diff), 5573a6b (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/io/test-sink.c
rd64f56d r65628c4 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.