- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/src/io/test-source_multi.c
ra06ab19 r59c4e5d 17 17 PRINT_MSG(" - read file.wav at original samplerate with 4096 blocks\n"); 18 18 PRINT_MSG(" %s file.wav 0 4096 \n", argv[0]); 19 PRINT_MSG(" - read file.wav at original samplerate with 256 frames blocks, mono\n");20 PRINT_MSG(" %s file.wav 0 4096 1\n", argv[0]);21 19 return err; 22 20 } … … 25 23 uint_t hop_size = 256; 26 24 uint_t n_frames = 0, read = 0; 27 uint_t n_channels = 0; 28 if ( argc >= 3 ) samplerate = atoi(argv[2]); 29 if ( argc >= 4 ) hop_size = atoi(argv[3]); 30 if ( argc >= 5 ) n_channels = atoi(argv[4]); 25 if ( argc == 3 ) samplerate = atoi(argv[2]); 26 if ( argc == 4 ) hop_size = atoi(argv[3]); 31 27 32 28 char_t *source_path = argv[1]; … … 35 31 if (!s) { err = -1; goto beach; } 36 32 37 if ( 33 if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(s); 38 34 39 if ( n_channels == 0 ) n_channels = aubio_source_get_channels(s); 40 41 fmat_t *mat = new_fmat(hop_size, n_channels); 35 fmat_t *mat = new_fmat(hop_size, aubio_source_get_channels(s) ); 42 36 43 37 do { … … 47 41 } while ( read == hop_size ); 48 42 49 PRINT_MSG("read %d frames in %d channels at %dHz (%d blocks) from %s\n",50 n_frames, n_channels, samplerate,n_frames / hop_size, source_path);43 PRINT_MSG("read %d frames at %dHz (%d blocks) from %s\n", n_frames, samplerate, 44 n_frames / hop_size, source_path); 51 45 52 46 del_fmat (mat);
Note: See TracChangeset
for help on using the changeset viewer.