Changeset 70585a5 for examples


Ignore:
Timestamp:
Nov 21, 2007, 4:53:13 PM (17 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:
66a1b955
Parents:
b050e8e (diff), 15b97d9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge from main branch

Location:
examples
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • examples/aubioonset.c

    rb050e8e r70585a5  
    7272      if (isonset && output_filename == NULL) {
    7373        if(frames >= 4) {
    74           outmsg("%f\n",(frames-4)*overlap_size/(float)samplerate);
    75         } else if (frames < 4) {
     74          outmsg("%f\n",(frames-frames_delay)*overlap_size/(float)samplerate);
     75        } else if (frames < frames_delay) {
    7676          outmsg("%f\n",0.);
    7777        }
     
    8080
    8181int main(int argc, char **argv) {
     82  frames_delay = 4;
    8283  examples_common_init(argc,argv);
    8384  examples_common_process(aubio_process,process_print);
  • examples/utils.c

    rb050e8e r70585a5  
    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; (signed)i < frames_delay; i++) {
     417    process_func(ibuf->data, obuf->data, overlap_size);
     418    print();
     419  }
     420}
    405421
    406422
  • examples/utils.h

    rb050e8e r70585a5  
    4242extern int usejack;
    4343extern int usedoubled;
     44extern int frames_delay;
    4445extern unsigned int median;
    4546extern const char * output_filename;
Note: See TracChangeset for help on using the changeset viewer.