Ignore:
File:
1 edited

Legend:

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

    r08bd8e0 r3286230  
    2323  uint_t hop_size = 256;
    2424  uint_t n_frames = 0, read = 0;
    25   uint_t old_n_frames_1, old_n_frames_2, old_n_frames_3;
     25  uint_t old_n_frames;
    2626  if ( argc == 3 ) samplerate = atoi(argv[2]);
    2727  if ( argc == 4 ) hop_size = atoi(argv[3]);
     
    4242  } while ( read == hop_size );
    4343
    44   PRINT_MSG("read %.2fs, %d frames at %dHz (%d blocks) from %s\n",
    45       n_frames * 1. / samplerate,
    46       n_frames, samplerate,
    47       n_frames / hop_size, source_path);
    48 
    49   old_n_frames_1 = n_frames;
     44  PRINT_MSG("read %d frames at %dHz (%d blocks) from %s\n", n_frames, samplerate,
     45    n_frames / hop_size, source_path);
    5046
    5147  aubio_source_seek (s, 0);
     48
     49  old_n_frames = n_frames;
    5250
    5351  n_frames = 0;
     
    5856  } while ( read == hop_size );
    5957
    60   PRINT_MSG("read %.2fs, %d frames at %dHz (%d blocks) from %s\n",
    61       n_frames * 1. / samplerate,
    62       n_frames, samplerate,
    63       n_frames / hop_size, source_path);
    64 
    65   old_n_frames_2 = n_frames;
    66 
    67   aubio_source_seek (s, n_frames / 2);
    68 
    69   n_frames = 0;
    70   do {
    71     aubio_source_do(s, vec, &read);
    72     //fvec_print (vec);
    73     n_frames += read;
    74   } while ( read == hop_size );
    75 
    76   PRINT_MSG("read %.2fs, %d frames at %dHz (%d blocks) from %s\n",
    77       n_frames * 1. / samplerate,
    78       n_frames, samplerate,
    79       n_frames / hop_size, source_path);
    80 
    81   old_n_frames_3 = n_frames;
     58  PRINT_MSG("read %d frames at %dHz (%d blocks) from %s\n", n_frames, samplerate,
     59    n_frames / hop_size, source_path);
    8260
    8361  del_aubio_source (s);
     
    8563  del_fvec (vec);
    8664
    87   assert ( old_n_frames_2 == old_n_frames_1 );
    88   assert ( old_n_frames_3 == (uint_t)floor(old_n_frames_1 / 2. + .5) );
     65  assert ( n_frames == old_n_frames );
    8966  return err;
    9067}
Note: See TracChangeset for help on using the changeset viewer.