Changeset 9f68f11 for tests/src/io/test-sink_apple_audio.c
- Timestamp:
- Feb 23, 2014, 3:13:26 AM (10 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:
- a559796
- Parents:
- d7ac23f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/io/test-sink_apple_audio.c
rd7ac23f r9f68f11 13 13 err = 2; 14 14 PRINT_ERR("not enough arguments\n"); 15 PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] \n", argv[0]);15 PRINT_MSG("usage: %s <input_path> <output_path> [samplerate] [hop_size]\n", argv[0]); 16 16 return err; 17 17 } … … 24 24 char_t *source_path = argv[1]; 25 25 char_t *sink_path = argv[2]; 26 if ( argc == 4 ) samplerate = atoi(argv[3]); 26 27 if ( argc >= 4 ) samplerate = atoi(argv[3]); 28 if ( argc >= 5 ) hop_size = atoi(argv[4]); 29 if ( argc >= 6 ) { 30 err = 2; 31 PRINT_ERR("too many arguments\n"); 32 return err; 33 } 27 34 28 35 fvec_t *vec = new_fvec(hop_size); 36 if (!vec) { err = 1; goto beach_fvec; } 37 29 38 aubio_source_t *i = new_aubio_source(source_path, samplerate, hop_size); 39 if (!i) { err = 1; goto beach_source; } 40 30 41 if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(i); 42 31 43 aubio_sink_apple_audio_t *o = new_aubio_sink_apple_audio(sink_path, samplerate); 32 33 if (!i || !o) { err = 1; goto beach; } 44 if (!o) { err = 1; goto beach_sink; } 34 45 35 46 do { … … 39 50 } while ( read == hop_size ); 40 51 41 PRINT_MSG("%d frames read from %s\n written to %s at %dHz\n", 42 n_frames, source_path, sink_path, samplerate); 52 PRINT_MSG("read %d frames at %dHz (%d blocks) from %s written to %s\n", 53 n_frames, samplerate, n_frames / hop_size, 54 source_path, sink_path); 43 55 44 beach: 56 del_aubio_sink_apple_audio(o); 57 beach_sink: 45 58 del_aubio_source(i); 46 del_aubio_sink_apple_audio(o); 59 beach_source: 47 60 del_fvec(vec); 61 beach_fvec: 48 62 #else 49 63 err = 3;
Note: See TracChangeset
for help on using the changeset viewer.