Changeset e24378a for examples/utils.c


Ignore:
Timestamp:
Nov 13, 2007, 9:15:35 AM (13 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
ec0d43c
Parents:
941801f
Message:

examples/utils.{c,h}, examples/aubioonset.c: added process_flush function to get last onset at the end of file, added frames_delay parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/utils.c

    r941801f re24378a  
    2222void save_data (void);
    2323void restore_data(lash_config_t * lash_config);
     24void flush_process(aubio_process_func_t process_func, aubio_print_func_t print);
    2425pthread_t lash_thread;
    2526#endif /* LASH_SUPPORT */
     
    3334int usejack = 0;
    3435int usedoubled = 1;
     36int frames_delay = 0;
    3537
    3638
     
    395397
    396398    debug("Processed %d frames of %d samples.\n", frames, buffer_size);
     399
     400    flush_process(process_func, print);
    397401    del_aubio_sndfile(file);
    398402
     
    403407}
    404408
     409void flush_process(aubio_process_func_t process_func, aubio_print_func_t print){
     410  uint i,j;
     411  for (i = 0; i < channels; i++) {
     412    for (j = 0; j < obuf->length; j++) {
     413      fvec_write_sample(obuf,0.,i,j);
     414    }
     415  }
     416  for (i = 0; i < frames_delay; i++) {
     417    process_func(ibuf->data, obuf->data, overlap_size);
     418    print();
     419  }
     420}
    405421
    406422
Note: See TracChangeset for help on using the changeset viewer.