Changeset 61043ed


Ignore:
Timestamp:
Dec 11, 2009, 4:36:43 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:
40a05d3
Parents:
2c50da9
Message:

utils.c: woodblock vector is overlap_size long

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/utils.c

    r2c50da9 r61043ed  
    208208  parse_args (argc, argv);
    209209
    210   woodblock = new_fvec (buffer_size, 1);
     210  if (!usejack) {
     211    debug ("Opening files ...\n");
     212    file = new_aubio_sndfile_ro (input_filename);
     213    if (file == NULL) {
     214      outmsg ("Could not open input file %s.\n", input_filename);
     215      exit (1);
     216    }
     217    if (verbose)
     218      aubio_sndfile_info (file);
     219    channels = aubio_sndfile_channels (file);
     220    samplerate = aubio_sndfile_samplerate (file);
     221    if (output_filename != NULL)
     222      fileout = new_aubio_sndfile_wo (file, output_filename);
     223  }
     224#ifdef HAVE_LASH
     225  else {
     226    aubio_lash_client = lash_init (lash_args, argv[0],
     227        LASH_Config_Data_Set | LASH_Terminal, LASH_PROTOCOL (2, 0));
     228    if (!aubio_lash_client) {
     229      fprintf (stderr, "%s: could not initialise lash\n", __FUNCTION__);
     230    }
     231    /* tell the lash server our client id */
     232    if (lash_enabled (aubio_lash_client)) {
     233      lash_event_t *event =
     234          (lash_event_t *) lash_event_new_with_type (LASH_Client_Name);
     235      lash_event_set_string (event, "aubio");
     236      lash_send_event (aubio_lash_client, event);
     237      pthread_create (&lash_thread, NULL, lash_thread_main, NULL);
     238    }
     239  }
     240#endif /* HAVE_LASH */
     241
     242  woodblock = new_fvec (overlap_size, channels);
    211243  if (output_filename || usejack) {
    212244    /* dummy assignement to keep egcs happy */
     
    223255    aubio_sndfile_read (onsetfile, overlap_size, woodblock);
    224256  }
    225 
    226   if (!usejack) {
    227     debug ("Opening files ...\n");
    228     file = new_aubio_sndfile_ro (input_filename);
    229     if (file == NULL) {
    230       outmsg ("Could not open input file %s.\n", input_filename);
    231       exit (1);
    232     }
    233     if (verbose)
    234       aubio_sndfile_info (file);
    235     channels = aubio_sndfile_channels (file);
    236     samplerate = aubio_sndfile_samplerate (file);
    237     if (output_filename != NULL)
    238       fileout = new_aubio_sndfile_wo (file, output_filename);
    239   }
    240 #ifdef HAVE_LASH
    241   else {
    242     aubio_lash_client = lash_init (lash_args, argv[0],
    243         LASH_Config_Data_Set | LASH_Terminal, LASH_PROTOCOL (2, 0));
    244     if (!aubio_lash_client) {
    245       fprintf (stderr, "%s: could not initialise lash\n", __FUNCTION__);
    246     }
    247     /* tell the lash server our client id */
    248     if (lash_enabled (aubio_lash_client)) {
    249       lash_event_t *event =
    250           (lash_event_t *) lash_event_new_with_type (LASH_Client_Name);
    251       lash_event_set_string (event, "aubio");
    252       lash_send_event (aubio_lash_client, event);
    253       pthread_create (&lash_thread, NULL, lash_thread_main, NULL);
    254     }
    255   }
    256 #endif /* HAVE_LASH */
    257257
    258258  ibuf = new_fvec (overlap_size, channels);
Note: See TracChangeset for help on using the changeset viewer.