Index: examples/aubiomfcc.c
===================================================================
--- examples/aubiomfcc.c	(revision 87b0c03a3df667611bd79aac04c4df265e04e453)
+++ examples/aubiomfcc.c	(revision 5a6667719aa121ff8f5c85467654a23fa7c0ca9d)
@@ -66,5 +66,5 @@
       
       uint_t coef_cnt;
-      if (output_filename == NULL) {
+      if (sink_uri == NULL) {
         outmsg("%f\t",frames*overlap_size/(float)samplerate);
         for (coef_cnt = 0; coef_cnt < n_coefs; coef_cnt++) {
Index: examples/aubiotrack.c
===================================================================
--- examples/aubiotrack.c	(revision 87b0c03a3df667611bd79aac04c4df265e04e453)
+++ examples/aubiotrack.c	(revision 5a6667719aa121ff8f5c85467654a23fa7c0ca9d)
@@ -57,5 +57,5 @@
 
 static void process_print (void) {
-        if (output_filename == NULL) {
+        if (sink_uri == NULL) {
                 if (istactus) {
                         outmsg("%f\n",((smpl_t)(frames*overlap_size)+(istactus-1.)*overlap_size)/(smpl_t)samplerate); 
Index: examples/utils.c
===================================================================
--- examples/utils.c	(revision 87b0c03a3df667611bd79aac04c4df265e04e453)
+++ examples/utils.c	(revision 5a6667719aa121ff8f5c85467654a23fa7c0ca9d)
@@ -42,8 +42,6 @@
 
 /* settings */
-const char *output_filename = NULL;
-const char *input_filename = NULL;
-const char *onset_filename =
-    AUBIO_PREFIX "/share/sounds/" PACKAGE "/woodblock.aiff";
+const char *sink_uri = NULL;
+const char *source_uri = NULL;
 int frames = 0;
 int verbose = 0;
@@ -64,11 +62,6 @@
 
 
-#ifdef HAVE_SNDFILE
-aubio_sndfile_t *file = NULL;
-aubio_sndfile_t *fileout = NULL;
-#else
-void *file = NULL;
-void *fileout = NULL;
-#endif
+aubio_source_t *this_source = NULL;
+aubio_sink_t *this_sink = NULL;
 
 fvec_t *ibuf;
@@ -136,8 +129,8 @@
     switch (next_option) {
       case 'o':
-        output_filename = optarg;
+        sink_uri = optarg;
         break;
       case 'i':
-        input_filename = optarg;
+        source_uri = optarg;
         break;
       case 'h':                /* help */
@@ -183,9 +176,9 @@
   while (next_option != -1);
 
-  if (input_filename != NULL) {
-    debug ("Input file : %s\n", input_filename);
-  } else if (input_filename != NULL && output_filename != NULL) {
-    debug ("Input file : %s\n", input_filename);
-    debug ("Output file : %s\n", output_filename);
+  if (source_uri != NULL) {
+    debug ("Input file : %s\n", source_uri);
+  } else if (source_uri != NULL && sink_uri != NULL) {
+    debug ("Input file : %s\n", source_uri);
+    debug ("Output file : %s\n", sink_uri);
   } else {
 #if HAVE_JACK
@@ -202,13 +195,8 @@
 }
 
-#ifdef HAVE_SNDFILE
-
 void
 examples_common_init (int argc, char **argv)
 {
 
-  uint_t found_wood = 0;
-
-  aubio_sndfile_t *onsetfile = NULL;
   /* parse command line arguments */
   parse_args (argc, argv);
@@ -216,14 +204,16 @@
   if (!usejack) {
     debug ("Opening files ...\n");
-    file = new_aubio_sndfile_ro (input_filename);
-    if (file == NULL) {
-      outmsg ("Could not open input file %s.\n", input_filename);
+    // TODO get actual samplerate
+    samplerate = 44100;
+    this_source = new_aubio_source ((char_t*)source_uri, samplerate, overlap_size);
+    if (this_source == NULL) {
+      outmsg ("Could not open input file %s.\n", source_uri);
       exit (1);
     }
-    if (verbose)
-      aubio_sndfile_info (file);
-    samplerate = aubio_sndfile_samplerate (file);
-    if (output_filename != NULL)
-      fileout = new_aubio_sndfile_wo (file, output_filename);
+    // TODO get actual samplerate
+    //samplerate = aubio_sndfile_samplerate (this_source);
+    if (sink_uri != NULL) {
+      this_sink = new_aubio_sink ((char_t*)sink_uri, samplerate);
+    }
   }
 #ifdef HAVE_LASH
@@ -246,18 +236,5 @@
 
   woodblock = new_fvec (overlap_size);
-  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_mono (onsetfile, overlap_size, woodblock);
-  }
+  //TODO create woodblock sound
 
   ibuf = new_fvec (overlap_size);
@@ -266,24 +243,10 @@
 }
 
-#else /* HAVE_SNDFILE */
-
-void
-examples_common_init (int argc, char **argv)
-{
-  outmsg ("Error, compiled without sndfile, nothing to do for now!\n");
-}
-
-
-#endif /* HAVE_SNDFILE */
-
-
 void
 examples_common_del (void)
 {
-#if HAVE_SNDFILE
   del_fvec (ibuf);
   del_fvec (obuf);
   del_fvec (woodblock);
-#endif
   aubio_cleanup ();
 }
@@ -293,10 +256,10 @@
 #endif
 
-#if HAVE_SNDFILE
-
 void
 examples_common_process (aubio_process_func_t process_func,
     aubio_print_func_t print)
 {
+
+  uint_t read = 0;
   if (usejack) {
 
@@ -321,34 +284,22 @@
     frames = 0;
 
-    while ((signed) overlap_size ==
-        aubio_sndfile_read_mono (file, overlap_size, ibuf)) {
+    do {
+      aubio_source_do (this_source, ibuf, &read);
       process_func (&ibuf->data, &obuf->data, overlap_size);
       print ();
-      if (output_filename != NULL) {
-        aubio_sndfile_write (fileout, overlap_size, &obuf);
+      if (this_sink) {
+        aubio_sink_do (this_sink, obuf, overlap_size);
       }
       frames++;
-    }
+    } while (read == overlap_size);
 
     debug ("Processed %d frames of %d samples.\n", frames, buffer_size);
 
     flush_process (process_func, print);
-    del_aubio_sndfile (file);
-
-    if (output_filename != NULL)
-      del_aubio_sndfile (fileout);
-
-  }
-}
-
-#else /* HAVE_SNDFILE */
-
-void
-examples_common_process (aubio_process_func_t process_func,
-    aubio_print_func_t print)
-{
-}
-
-#endif /* HAVE_SNDFILE */
+    del_aubio_source (this_source);
+    del_aubio_sink   (this_sink);
+
+  }
+}
 
 void
Index: examples/utils.h
===================================================================
--- examples/utils.h	(revision 87b0c03a3df667611bd79aac04c4df265e04e453)
+++ examples/utils.h	(revision 5a6667719aa121ff8f5c85467654a23fa7c0ca9d)
@@ -65,5 +65,5 @@
 void send_noteon (int pitch, int velo);
 
-extern const char *output_filename;
+extern const char *sink_uri;
 extern char_t * onset_mode;
 extern smpl_t threshold;
