Changeset 953cde5
- Timestamp:
- Nov 29, 2018, 5:05:28 PM (6 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
- Children:
- 9ffa590
- Parents:
- 92c85b12
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/synth/test-sampler.c
r92c85b12 r953cde5 1 #include <string.h> // strncpy 2 #include <limits.h> // PATH_MAX 1 3 #include <aubio.h> 2 4 #include "utils_tests.h" … … 6 8 sint_t err = 0; 7 9 8 if (argc < 4) {9 err = 2;10 PRINT_ERR("not enough arguments\n");10 if (argc < 3) { 11 PRINT_ERR("not enough arguments, running tests\n"); 12 err = run_on_default_source_and_sink(main); 11 13 PRINT_MSG("usage: %s <input_path> <output_path> <sample_path> [samplerate]\n", argv[0]); 12 14 return err; … … 19 21 char_t *source_path = argv[1]; 20 22 char_t *sink_path = argv[2]; 21 char_t *sample_path = argv[3]; 22 if ( argc == 5 ) samplerate = atoi(argv[4]); 23 char_t sample_path[PATH_MAX]; 24 if ( argc >= 4 ) { 25 strncpy(sample_path, argv[3], PATH_MAX - 1); 26 } else { 27 // use input_path as sample 28 strncpy(sample_path, source_path, PATH_MAX - 1); 29 } 30 sample_path[PATH_MAX - 1] = '\0'; 31 if ( argc >= 5 ) samplerate = atoi(argv[4]); 23 32 24 33 fvec_t *vec = new_fvec(hop_size);
Note: See TracChangeset
for help on using the changeset viewer.