Changeset 54a5d56


Ignore:
Timestamp:
Sep 12, 2009, 1:14:53 PM (15 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:
4e19e5b
Parents:
0482e76
Message:

examples/aubiotrack.c: compute sample accurate beat position

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/aubiotrack.c

    r0482e76 r54a5d56  
    2424fvec_t * out              = NULL;
    2525aubio_tempo_t * bt        = NULL;
    26 uint_t istactus           = 0;
     26smpl_t istactus           = 0;
    2727
    2828int aubio_process(float **input, float **output, int nframes);
     
    4343      /* block loop */
    4444      aubio_tempo(bt,ibuf,out);
    45       if (out->data[0][0]==1)
    46         istactus = 1;
     45      if (out->data[0][0]>=1)
     46        istactus = out->data[0][0];
    4747      else
    4848        istactus = 0;
     
    6565void process_print (void) {
    6666        if (output_filename == NULL) {
    67                 if (istactus)
    68                         outmsg("%f\n",(frames)*overlap_size/(float)samplerate);
     67                if (istactus) {
     68                        outmsg("%f\n",((smpl_t)(frames*overlap_size)+(istactus-1.)*overlap_size)/(smpl_t)samplerate);
     69                }
    6970                if (isonset && verbose)
    7071                        outmsg(" \t \t%f\n",(frames)*overlap_size/(float)samplerate);
Note: See TracChangeset for help on using the changeset viewer.