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/aubiomfcc.c

    rc17a0ee r4621cd6  
    3333
    3434static int aubio_process(smpl_t **input, smpl_t **output, int nframes) {
    35   unsigned int i;       /*channels*/
    3635  unsigned int j;       /*frames*/
    3736 
    3837  for (j=0;j<(unsigned)nframes;j++) {
    3938    if(usejack) {
    40       for (i=0;i<channels;i++) {
    41         /* write input to datanew */
    42         fvec_write_sample(ibuf, input[i][j], i, pos);
    43         /* put synthnew in output */
    44         output[i][j] = fvec_read_sample(obuf, i, pos);
    45       }
     39      /* write input to datanew */
     40      fvec_write_sample(ibuf, input[0][j], pos);
     41      /* put synthnew in output */
     42      output[0][j] = fvec_read_sample(obuf, pos);
    4643    }
    4744    /*time for fft*/
     
    5047     
    5148      //compute mag spectrum
    52       aubio_pvoc_do (pv,ibuf, fftgrain);
     49      aubio_pvoc_do (pv, ibuf, fftgrain);
    5350     
    5451      //compute mfccs
     
    7269        outmsg("%f\t",frames*overlap_size/(float)samplerate);
    7370        for (coef_cnt = 0; coef_cnt < n_coefs; coef_cnt++) {
    74             outmsg("%f ", fvec_read_sample (mfcc_out, 0, coef_cnt) );
     71            outmsg("%f ", fvec_read_sample (mfcc_out, coef_cnt) );
    7572        }
    7673        outmsg("\n");
     
    8683
    8784  /* phase vocoder */
    88   pv = new_aubio_pvoc (buffer_size, overlap_size, channels);
     85  pv = new_aubio_pvoc (buffer_size, overlap_size);
    8986
    90   fftgrain = new_cvec (buffer_size, channels);
     87  fftgrain = new_cvec (buffer_size);
    9188
    9289  //populating the filter
    9390  mfcc = new_aubio_mfcc(buffer_size, n_filters, n_coefs, samplerate);
    9491 
    95   mfcc_out = new_fvec(n_coefs,channels);
     92  mfcc_out = new_fvec(n_coefs);
    9693 
    9794  //process
Note: See TracChangeset for help on using the changeset viewer.