Changeset 4621cd6 for examples/utils.c


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

    rc17a0ee r4621cd6  
    6161uint_t buffer_size = 512;       //1024;
    6262uint_t overlap_size = 256;      //512;
    63 uint_t channels = 1;
    6463uint_t samplerate = 44100;
    6564
     
    208207  parse_args (argc, argv);
    209208
    210   woodblock = new_fvec (buffer_size, 1);
     209  woodblock = new_fvec (overlap_size);
    211210  if (output_filename || usejack) {
    212211    /* dummy assignement to keep egcs happy */
     
    221220  if (onsetfile) {
    222221    /* read the output sound once */
    223     aubio_sndfile_read (onsetfile, overlap_size, woodblock);
     222    aubio_sndfile_read_mono (onsetfile, overlap_size, woodblock);
    224223  }
    225224
     
    233232    if (verbose)
    234233      aubio_sndfile_info (file);
    235     channels = aubio_sndfile_channels (file);
    236234    samplerate = aubio_sndfile_samplerate (file);
    237235    if (output_filename != NULL)
     
    256254#endif /* HAVE_LASH */
    257255
    258   ibuf = new_fvec (overlap_size, channels);
    259   obuf = new_fvec (overlap_size, channels);
     256  uint_t i;
     257  ibuf = new_fvec (overlap_size);
     258  obuf = new_fvec (overlap_size);
    260259
    261260}
     
    265264examples_common_del (void)
    266265{
     266  uint_t i;
    267267  del_fvec (ibuf);
    268268  del_fvec (obuf);
     
    283283#if HAVE_JACK
    284284    debug ("Jack init ...\n");
    285     jack_setup = new_aubio_jack (channels, channels,
     285    jack_setup = new_aubio_jack (1, 1,
    286286        0, 1, (aubio_process_func_t) process_func);
    287287    debug ("Jack activation ...\n");
     
    301301    frames = 0;
    302302
    303     while ((signed) overlap_size == aubio_sndfile_read (file, overlap_size,
    304             ibuf)) {
    305       process_func (ibuf->data, obuf->data, overlap_size);
     303    while ((signed) overlap_size ==
     304        aubio_sndfile_read_mono (file, overlap_size, ibuf)) {
     305      process_func (&ibuf->data, &obuf->data, overlap_size);
    306306      print ();
    307307      if (output_filename != NULL) {
    308         aubio_sndfile_write (fileout, overlap_size, obuf);
     308        aubio_sndfile_write (fileout, overlap_size, &obuf);
    309309      }
    310310      frames++;
     
    328328  fvec_zeros(obuf);
    329329  for (i = 0; (signed) i < frames_delay; i++) {
    330     process_func (ibuf->data, obuf->data, overlap_size);
     330    process_func (&ibuf->data, &obuf->data, overlap_size);
    331331    print ();
    332332  }
Note: See TracChangeset for help on using the changeset viewer.