shithub: aubio

Download patch

ref: f382ac69f6bf8b07b53a44090b2dd24bc6764750
parent: ee0cc27ba4e161979fb17eda9768daaf0ec19ae6
author: Paul Brossier <piem@altern.org>
date: Mon May 23 12:32:42 EDT 2005

start fixing woodblock filepaty
start fixing woodblock filepaty


--- a/examples/utils.c
+++ b/examples/utils.c
@@ -200,10 +200,19 @@
 void examples_common_init(int argc,char ** argv) {
 
 
-  aubio_file_t * onsetfile = new_file_ro(onset_filename);
+  aubio_file_t * onsetfile;
   /* parse command line arguments */
   parse_args(argc, argv);
 
+  woodblock = new_fvec(buffer_size,1);
+  if (output_filename || usejack) {
+          (onsetfile = new_file_ro(onset_filename)) ||
+                  (onsetfile = new_file_ro("sounds/woodblock.aiff")) ||
+                  (onsetfile = new_file_ro("../sounds/woodblock.aiff"));
+          /* read the output sound once */
+          file_read(onsetfile, overlap_size, woodblock);
+  }
+
   if(!usejack)
   {
     debug("Opening files ...\n");
@@ -217,7 +226,6 @@
 
   ibuf      = new_fvec(overlap_size, channels);
   obuf      = new_fvec(overlap_size, channels);
-  woodblock = new_fvec(buffer_size,1);
   fftgrain  = new_cvec(buffer_size, channels);
 
   if (usepitch) {
@@ -229,8 +237,6 @@
           note_buffer2= new_fvec(median, 1);
   }
   }
-  /* read the output sound once */
-  file_read(onsetfile, overlap_size, woodblock);
   /* phase vocoder */
   pv = new_aubio_pvoc(buffer_size, overlap_size, channels);
   /* onsets */
--- a/ext/sndfileio.c
+++ b/ext/sndfileio.c
@@ -44,14 +44,14 @@
         AUBIO_MEMSET(&sfinfo, 0, sizeof (sfinfo));
 
         if (! (f->handle = sf_open (outputname, SFM_READ, &sfinfo))) {
-                AUBIO_ERR("Not able to open input file %s.\n", outputname);
+                AUBIO_ERR("Unable to open input file %s.\n", outputname);
                 AUBIO_ERR("%s\n",sf_strerror (NULL)); /* libsndfile err msg */
-                AUBIO_QUIT(AUBIO_FAIL);
+                return NULL;
         }	
 
         if (sfinfo.channels > MAX_CHANNELS) { 
                 AUBIO_ERR("Not able to process more than %d channels\n", MAX_CHANNELS);
-                AUBIO_QUIT(AUBIO_FAIL);
+                return NULL;
         }
 
         f->size       = MAX_SIZE*sfinfo.channels;