Changeset 43ea60d for tests/src/io
- Timestamp:
- Dec 19, 2018, 2:53:18 PM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master
- Children:
- ee463f9
- Parents:
- 387b605
- Location:
- tests/src/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/io/base-sink_custom.h
r387b605 r43ea60d 26 26 char_t *sink_path = argv[2]; 27 27 28 aubio_source_t * i= NULL;29 aubio_sink_custom_t * o= NULL;28 aubio_source_t *src = NULL; 29 aubio_sink_custom_t *snk = NULL; 30 30 31 31 if ( argc >= 4 ) samplerate = atoi(argv[3]); … … 35 35 if (!vec) { err = 1; goto failure; } 36 36 37 i= new_aubio_source(source_path, samplerate, hop_size);38 if (! i) { err = 1; goto failure; }39 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); 40 40 41 o= new_aubio_sink_custom(sink_path, samplerate);42 if (! o) { err = 1; goto failure; }41 snk = new_aubio_sink_custom(sink_path, samplerate); 42 if (!snk) { err = 1; goto failure; } 43 43 44 44 do { 45 aubio_source_do( i, vec, &read);46 aubio_sink_custom_do( o, vec, read);45 aubio_source_do(src, vec, &read); 46 aubio_sink_custom_do(snk, vec, read); 47 47 n_frames += read; 48 48 } while ( read == hop_size ); … … 53 53 54 54 // close sink now (optional) 55 aubio_sink_custom_close( o);55 aubio_sink_custom_close(snk); 56 56 57 57 failure: 58 if ( o)59 del_aubio_sink_custom( o);60 if ( i)61 del_aubio_source( i);58 if (snk) 59 del_aubio_sink_custom(snk); 60 if (src) 61 del_aubio_source(src); 62 62 if (vec) 63 63 del_fvec(vec); -
tests/src/io/test-sink.c
r387b605 r43ea60d 22 22 char_t *sink_path = argv[2]; 23 23 24 aubio_source_t * i= NULL;25 aubio_sink_t * o= NULL;24 aubio_source_t *src = NULL; 25 aubio_sink_t *snk = NULL; 26 26 27 27 if ( argc >= 4 ) samplerate = atoi(argv[3]); … … 31 31 if (!vec) { err = 1; goto failure; } 32 32 33 i= new_aubio_source(source_path, samplerate, hop_size);34 if (! i) { err = 1; goto failure; }35 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); 36 36 37 o= new_aubio_sink(sink_path, samplerate);38 if (! o) { err = 1; goto failure; }37 snk = new_aubio_sink(sink_path, samplerate); 38 if (!snk) { err = 1; goto failure; } 39 39 40 40 do { 41 aubio_source_do( i, vec, &read);42 aubio_sink_do( o, vec, read);41 aubio_source_do(src, vec, &read); 42 aubio_sink_do(snk, vec, read); 43 43 n_frames += read; 44 44 } while ( read == hop_size ); … … 49 49 50 50 // close sink now (optional) 51 aubio_sink_close( o);51 aubio_sink_close(snk); 52 52 53 53 failure: 54 if ( o)55 del_aubio_sink( o);56 if ( i)57 del_aubio_source( i);54 if (snk) 55 del_aubio_sink(snk); 56 if (src) 57 del_aubio_source(src); 58 58 if (vec) 59 59 del_fvec(vec);
Note: See TracChangeset
for help on using the changeset viewer.