utils.c: woodblock vector is overlap_size long
authorPaul Brossier <piem@piem.org>
Fri, 11 Dec 2009 15:36:43 +0000 (16:36 +0100)
committerPaul Brossier <piem@piem.org>
Fri, 11 Dec 2009 15:36:43 +0000 (16:36 +0100)
examples/utils.c

index a9e77a2..6b6e00b 100644 (file)
@@ -207,22 +207,6 @@ examples_common_init (int argc, char **argv)
   /* parse command line arguments */
   parse_args (argc, argv);
 
-  woodblock = new_fvec (buffer_size, 1);
-  if (output_filename || usejack) {
-    /* dummy assignement to keep egcs happy */
-    found_wood = (onsetfile = new_aubio_sndfile_ro (onset_filename)) ||
-        (onsetfile = new_aubio_sndfile_ro ("sounds/woodblock.aiff")) ||
-        (onsetfile = new_aubio_sndfile_ro ("../sounds/woodblock.aiff"));
-    if (onsetfile == NULL) {
-      outmsg ("Could not find woodblock.aiff\n");
-      exit (1);
-    }
-  }
-  if (onsetfile) {
-    /* read the output sound once */
-    aubio_sndfile_read (onsetfile, overlap_size, woodblock);
-  }
-
   if (!usejack) {
     debug ("Opening files ...\n");
     file = new_aubio_sndfile_ro (input_filename);
@@ -255,6 +239,22 @@ examples_common_init (int argc, char **argv)
   }
 #endif /* HAVE_LASH */
 
+  woodblock = new_fvec (overlap_size, channels);
+  if (output_filename || usejack) {
+    /* dummy assignement to keep egcs happy */
+    found_wood = (onsetfile = new_aubio_sndfile_ro (onset_filename)) ||
+        (onsetfile = new_aubio_sndfile_ro ("sounds/woodblock.aiff")) ||
+        (onsetfile = new_aubio_sndfile_ro ("../sounds/woodblock.aiff"));
+    if (onsetfile == NULL) {
+      outmsg ("Could not find woodblock.aiff\n");
+      exit (1);
+    }
+  }
+  if (onsetfile) {
+    /* read the output sound once */
+    aubio_sndfile_read (onsetfile, overlap_size, woodblock);
+  }
+
   ibuf = new_fvec (overlap_size, channels);
   obuf = new_fvec (overlap_size, channels);