Changeset 5e9c68a for examples


Ignore:
Timestamp:
Aug 9, 2005, 7:56:21 PM (19 years ago)
Author:
Paul Brossier <piem@altern.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:
a29ad46
Parents:
28d8c4a
Message:

rename file_ to aubio_sndfile, protect aubio_pitdetection_{mode,type} enumerators

Location:
examples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • examples/utils.c

    r28d8c4a r5e9c68a  
    4040
    4141
    42 aubio_file_t * file = NULL;
    43 aubio_file_t * fileout = NULL;
     42aubio_sndfile_t * file = NULL;
     43aubio_sndfile_t * fileout = NULL;
    4444
    4545aubio_pvoc_t * pv;
     
    5959smpl_t pitch               = 0.;
    6060aubio_pitchdetection_t * pitchdet;
    61 aubio_pitchdetection_type mode = aubio_yin; // aubio_mcomb
     61aubio_pitchdetection_type mode = aubio_pitch_yin; // aubio_pitch_mcomb
    6262uint_t median         = 6;
    6363
     
    205205
    206206
    207   aubio_file_t * onsetfile;
     207  aubio_sndfile_t * onsetfile;
    208208  /* parse command line arguments */
    209209  parse_args(argc, argv);
     
    211211  woodblock = new_fvec(buffer_size,1);
    212212  if (output_filename || usejack) {
    213           (onsetfile = new_file_ro(onset_filename)) ||
    214                   (onsetfile = new_file_ro("sounds/woodblock.aiff")) ||
    215                   (onsetfile = new_file_ro("../sounds/woodblock.aiff"));
     213          (onsetfile = new_aubio_sndfile_ro(onset_filename)) ||
     214                  (onsetfile = new_aubio_sndfile_ro("sounds/woodblock.aiff")) ||
     215                  (onsetfile = new_aubio_sndfile_ro("../sounds/woodblock.aiff"));
    216216          /* read the output sound once */
    217           file_read(onsetfile, overlap_size, woodblock);
     217          aubio_sndfile_read(onsetfile, overlap_size, woodblock);
    218218  }
    219219
     
    221221  {
    222222    debug("Opening files ...\n");
    223     file = new_file_ro (input_filename);
    224     if (verbose) file_info(file);
    225     channels = aubio_file_channels(file);
    226     samplerate = aubio_file_samplerate(file);
     223    file = new_aubio_sndfile_ro (input_filename);
     224    if (verbose) aubio_sndfile_info(file);
     225    channels = aubio_sndfile_channels(file);
     226    samplerate = aubio_sndfile_samplerate(file);
    227227    if (output_filename != NULL)
    228       fileout = new_file_wo(file, output_filename);
     228      fileout = new_aubio_sndfile_wo(file, output_filename);
    229229  }
    230230
     
    235235  if (usepitch) {
    236236    pitchdet = new_aubio_pitchdetection(buffer_size*4,
    237                     overlap_size, channels, samplerate, mode, aubio_freq);
     237                    overlap_size, channels, samplerate, mode, aubio_pitchm_freq);
    238238 
    239239  if (median) {
     
    306306    frames = 0;
    307307
    308     while (overlap_size == file_read(file, overlap_size, ibuf))
     308    while (overlap_size == aubio_sndfile_read(file, overlap_size, ibuf))
    309309    {
    310310      isonset=0;
     
    312312      print();
    313313      if (output_filename != NULL) {
    314         file_write(fileout,overlap_size,obuf);
     314        aubio_sndfile_write(fileout,overlap_size,obuf);
    315315      }
    316316      frames++;
     
    318318
    319319    debug("Processed %d frames of %d samples.\n", frames, buffer_size);
    320     del_file(file);
     320    del_aubio_sndfile(file);
    321321
    322322    if (output_filename != NULL)
    323       del_file(fileout);
     323      del_aubio_sndfile(fileout);
    324324
    325325  }
  • examples/utils.h

    r28d8c4a r5e9c68a  
    7676
    7777
    78 extern aubio_file_t * file;
    79 extern aubio_file_t * fileout;
     78extern aubio_sndfile_t * file;
     79extern aubio_sndfile_t * fileout;
    8080
    8181extern aubio_pvoc_t * pv;
Note: See TracChangeset for help on using the changeset viewer.