Changeset fe163ad for tests/src


Ignore:
Timestamp:
Oct 15, 2009, 6:54:23 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:
515c7b2
Parents:
cd77c15
Message:

src/pitch: use a string to set pitch method, add a new function to set pitch unit, keep pitch enums private, update pitch methods where they are used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/src/test-pitchdetection.c

    rcd77c15 rfe163ad  
    11#include <aubio.h>
    22
    3 int main(){
    4         /* allocate some memory */
    5         uint_t win_s      = 1024;                       /* window size */
    6         uint_t hop_s      = win_s/4;                    /* hop size */
    7         uint_t samplerate = 44100;                      /* samplerate */
    8         uint_t channels   = 1;                          /* number of channel */
    9         aubio_pitchdetection_mode mode = aubio_pitchm_freq;
    10         aubio_pitchdetection_type type = aubio_pitch_yinfft;
    11         fvec_t * in       = new_fvec (hop_s, channels); /* input buffer */
    12         fvec_t * out       = new_fvec (1, channels); /* input buffer */
    13         aubio_pitchdetection_t * o  = new_aubio_pitchdetection(
    14           win_s, hop_s, channels, samplerate, type, mode
    15           );
    16         uint_t i = 0;
     3int
     4main ()
     5{
     6  /* allocate some memory */
     7  uint_t win_s = 1024;          /* window size */
     8  uint_t hop_s = win_s / 4;     /* hop size */
     9  uint_t samplerate = 44100;    /* samplerate */
     10  uint_t channels = 1;          /* number of channel */
     11  fvec_t *in = new_fvec (hop_s, channels);      /* input buffer */
     12  fvec_t *out = new_fvec (1, channels); /* input buffer */
     13  aubio_pitchdetection_t *o =
     14      new_aubio_pitchdetection ("default", win_s, hop_s, channels, samplerate);
     15  uint_t i = 0;
    1716
    18         while (i < 100) {
    19           aubio_pitchdetection_do (o,in, out);
    20           i++;
    21         };
     17  while (i < 100) {
     18    aubio_pitchdetection_do (o, in, out);
     19    i++;
     20  };
    2221
    23         del_aubio_pitchdetection(o);
    24         del_fvec(in);
    25         aubio_cleanup();
     22  del_aubio_pitchdetection (o);
     23  del_fvec (in);
     24  aubio_cleanup ();
    2625
    27         return 0;
     26  return 0;
    2827}
Note: See TracChangeset for help on using the changeset viewer.