Changeset a06ab19


Ignore:
Timestamp:
Sep 30, 2013, 5:18:49 PM (11 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
6f41b89
Parents:
50e10a9
git-author:
Paul Brossier <piem@piem.org> (09/26/13 21:58:00)
git-committer:
Paul Brossier <piem@piem.org> (09/30/13 17:18:49)
Message:

tests/src/io/test-source_multi.c: fix ho_size option, add channel option, improve display of result

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/src/io/test-source_multi.c

    r50e10a9 ra06ab19  
    1717    PRINT_MSG(" - read file.wav at original samplerate with 4096 blocks\n");
    1818    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]);
    1921    return err;
    2022  }
     
    2325  uint_t hop_size = 256;
    2426  uint_t n_frames = 0, read = 0;
    25   if ( argc == 3 ) samplerate = atoi(argv[2]);
    26   if ( argc == 4 ) hop_size = atoi(argv[3]);
     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]);
    2731
    2832  char_t *source_path = argv[1];
     
    3135  if (!s) { err = -1; goto beach; }
    3236
    33   if (samplerate == 0 ) samplerate = aubio_source_get_samplerate(s);
     37  if ( samplerate == 0 ) samplerate = aubio_source_get_samplerate(s);
    3438
    35   fmat_t *mat = new_fmat(hop_size, aubio_source_get_channels(s) );
     39  if ( n_channels == 0 ) n_channels = aubio_source_get_channels(s);
     40
     41  fmat_t *mat = new_fmat(hop_size, n_channels);
    3642
    3743  do {
     
    4147  } while ( read == hop_size );
    4248
    43   PRINT_MSG("read %d frames at %dHz (%d blocks) from %s\n", n_frames, samplerate,
    44     n_frames / hop_size, source_path);
     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);
    4551
    4652  del_fmat (mat);
Note: See TracChangeset for help on using the changeset viewer.