Ignore:
Timestamp:
Dec 4, 2009, 1:46:40 AM (14 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:
aea235c
Parents:
c17a0ee
Message:

examples: switch to mono

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/aubiopitch.c

    rc17a0ee r4621cd6  
    2727
    2828static int aubio_process(smpl_t **input, smpl_t **output, int nframes) {
    29   unsigned int i;       /*channels*/
    3029  unsigned int j;       /*frames*/
    3130  for (j=0;j<(unsigned)nframes;j++) {
    3231    if(usejack) {
    33       for (i=0;i<channels;i++) {
    34         /* write input to datanew */
    35         fvec_write_sample(ibuf, input[i][j], i, pos);
    36         /* put synthnew in output */
    37         output[i][j] = fvec_read_sample(obuf, i, pos);
    38       }
     32      /* write input to datanew */
     33      fvec_write_sample(ibuf, input[0][j], pos);
     34      /* put synthnew in output */
     35      output[0][j] = fvec_read_sample(obuf, pos);
    3936    }
    4037    /*time for fft*/
     
    4239      /* block loop */
    4340      aubio_pitch_do (o, ibuf, pitch);
    44       if (fvec_read_sample(pitch, 0, 0)) {
     41      if (fvec_read_sample(pitch, 0)) {
    4542        for (pos = 0; pos < overlap_size; pos++){
    4643          // TODO, play sine at this freq
     
    5956static void process_print (void) {
    6057      if (!verbose && usejack) return;
    61       smpl_t pitch_found = fvec_read_sample(pitch, 0, 0);
     58      smpl_t pitch_found = fvec_read_sample(pitch, 0);
    6259      outmsg("%f %f\n",(frames)
    6360              *overlap_size/(float)samplerate, pitch_found);
     
    6764  examples_common_init(argc,argv);
    6865
    69   o = new_aubio_pitch (onset_mode, buffer_size, overlap_size, channels,
    70           samplerate);
    71   pitch = new_fvec (1, channels);
     66  o = new_aubio_pitch (onset_mode, buffer_size, overlap_size, samplerate);
     67  pitch = new_fvec (1);
    7268
    7369  examples_common_process(aubio_process,process_print);
Note: See TracChangeset for help on using the changeset viewer.