Index: src/spectral/fft.c
===================================================================
--- src/spectral/fft.c	(revision 4ed0ed1f6cac63c8081b9e63c3dcaf49af606b89)
+++ src/spectral/fft.c	(revision 5c6b26451650fa43935a0d526615698b024f1be7)
@@ -85,5 +85,5 @@
 #else                         // using OOURA
 // let's use ooura instead
-extern void rdft(int, int, double *, int *, double *);
+extern void rdft(int, int, smpl_t *, int *, smpl_t *);
 
 #endif /* HAVE_ACCELERATE */
@@ -110,6 +110,6 @@
 #endif
 #else                         // using OOURA
-  double *in, *out;
-  double *w;
+  smpl_t *in, *out;
+  smpl_t *w;
   int *ip;
 #endif /* HAVE_ACCELERATE */
@@ -171,8 +171,8 @@
   s->fft_size = winsize / 2 + 1;
   s->compspec = new_fvec(winsize);
-  s->in    = AUBIO_ARRAY(double, s->winsize);
-  s->out   = AUBIO_ARRAY(double, s->winsize);
+  s->in    = AUBIO_ARRAY(smpl_t, s->winsize);
+  s->out   = AUBIO_ARRAY(smpl_t, s->winsize);
   s->ip    = AUBIO_ARRAY(int   , s->fft_size);
-  s->w     = AUBIO_ARRAY(double, s->fft_size);
+  s->w     = AUBIO_ARRAY(smpl_t, s->fft_size);
   s->ip[0] = 0;
 #endif /* HAVE_ACCELERATE */
Index: src/spectral/ooura_fft8g.c
===================================================================
--- src/spectral/ooura_fft8g.c	(revision 4ed0ed1f6cac63c8081b9e63c3dcaf49af606b89)
+++ src/spectral/ooura_fft8g.c	(revision 5c6b26451650fa43935a0d526615698b024f1be7)
@@ -1,2 +1,8 @@
+// 2 modifications made for aubio:
+//  - replace all 'double' with 'smpl_t'
+//  - include "aubio_priv.h" (for config.h and types.h)
+
+#include "aubio_priv.h"
+
 /*
 Fast Fourier/Cosine/Sine Transform
@@ -15,10 +21,10 @@
     dfst: Sine Transform of RDFT (Real Anti-symmetric DFT)
 function prototypes
-    void cdft(int, int, double *, int *, double *);
-    void rdft(int, int, double *, int *, double *);
-    void ddct(int, int, double *, int *, double *);
-    void ddst(int, int, double *, int *, double *);
-    void dfct(int, double *, double *, int *, double *);
-    void dfst(int, double *, double *, int *, double *);
+    void cdft(int, int, smpl_t *, int *, smpl_t *);
+    void rdft(int, int, smpl_t *, int *, smpl_t *);
+    void ddct(int, int, smpl_t *, int *, smpl_t *);
+    void ddst(int, int, smpl_t *, int *, smpl_t *);
+    void dfct(int, smpl_t *, smpl_t *, int *, smpl_t *);
+    void dfst(int, smpl_t *, smpl_t *, int *, smpl_t *);
 
 
@@ -40,5 +46,5 @@
         2*n            :data length (int)
                         n >= 1, n = power of 2
-        a[0...2*n-1]   :input/output data (double *)
+        a[0...2*n-1]   :input/output data (smpl_t *)
                         input data
                             a[2*j] = Re(x[j]), 
@@ -53,5 +59,5 @@
                             2+(1<<(int)(log(n+0.5)/log(2))/2).
                         ip[0],ip[1] are pointers of the cos/sin table.
-        w[0...n/2-1]   :cos/sin table (double *)
+        w[0...n/2-1]   :cos/sin table (smpl_t *)
                         w[],ip[] are initialized if ip[0] == 0.
     [remark]
@@ -85,5 +91,5 @@
         n              :data length (int)
                         n >= 2, n = power of 2
-        a[0...n-1]     :input/output data (double *)
+        a[0...n-1]     :input/output data (smpl_t *)
                         <case1>
                             output data
@@ -102,5 +108,5 @@
                             2+(1<<(int)(log(n/2+0.5)/log(2))/2).
                         ip[0],ip[1] are pointers of the cos/sin table.
-        w[0...n/2-1]   :cos/sin table (double *)
+        w[0...n/2-1]   :cos/sin table (smpl_t *)
                         w[],ip[] are initialized if ip[0] == 0.
     [remark]
@@ -131,5 +137,5 @@
         n              :data length (int)
                         n >= 2, n = power of 2
-        a[0...n-1]     :input/output data (double *)
+        a[0...n-1]     :input/output data (smpl_t *)
                         output data
                             a[k] = C[k], 0<=k<n
@@ -140,5 +146,5 @@
                             2+(1<<(int)(log(n/2+0.5)/log(2))/2).
                         ip[0],ip[1] are pointers of the cos/sin table.
-        w[0...n*5/4-1] :cos/sin table (double *)
+        w[0...n*5/4-1] :cos/sin table (smpl_t *)
                         w[],ip[] are initialized if ip[0] == 0.
     [remark]
@@ -170,5 +176,5 @@
         n              :data length (int)
                         n >= 2, n = power of 2
-        a[0...n-1]     :input/output data (double *)
+        a[0...n-1]     :input/output data (smpl_t *)
                         <case1>
                             input data
@@ -187,5 +193,5 @@
                             2+(1<<(int)(log(n/2+0.5)/log(2))/2).
                         ip[0],ip[1] are pointers of the cos/sin table.
-        w[0...n*5/4-1] :cos/sin table (double *)
+        w[0...n*5/4-1] :cos/sin table (smpl_t *)
                         w[],ip[] are initialized if ip[0] == 0.
     [remark]
@@ -210,8 +216,8 @@
         n              :data length - 1 (int)
                         n >= 2, n = power of 2
-        a[0...n]       :input/output data (double *)
+        a[0...n]       :input/output data (smpl_t *)
                         output data
                             a[k] = C[k], 0<=k<=n
-        t[0...n/2]     :work area (double *)
+        t[0...n/2]     :work area (smpl_t *)
         ip[0...*]      :work area for bit reversal (int *)
                         length of ip >= 2+sqrt(n/4)
@@ -220,5 +226,5 @@
                             2+(1<<(int)(log(n/4+0.5)/log(2))/2).
                         ip[0],ip[1] are pointers of the cos/sin table.
-        w[0...n*5/8-1] :cos/sin table (double *)
+        w[0...n*5/8-1] :cos/sin table (smpl_t *)
                         w[],ip[] are initialized if ip[0] == 0.
     [remark]
@@ -246,9 +252,9 @@
         n              :data length + 1 (int)
                         n >= 2, n = power of 2
-        a[0...n-1]     :input/output data (double *)
+        a[0...n-1]     :input/output data (smpl_t *)
                         output data
                             a[k] = S[k], 0<k<n
                         (a[0] is used for work area)
-        t[0...n/2-1]   :work area (double *)
+        t[0...n/2-1]   :work area (smpl_t *)
         ip[0...*]      :work area for bit reversal (int *)
                         length of ip >= 2+sqrt(n/4)
@@ -257,5 +263,5 @@
                             2+(1<<(int)(log(n/4+0.5)/log(2))/2).
                         ip[0],ip[1] are pointers of the cos/sin table.
-        w[0...n*5/8-1] :cos/sin table (double *)
+        w[0...n*5/8-1] :cos/sin table (smpl_t *)
                         w[],ip[] are initialized if ip[0] == 0.
     [remark]
@@ -276,11 +282,11 @@
 
 
-void cdft(int n, int isgn, double *a, int *ip, double *w)
-{
-    void makewt(int nw, int *ip, double *w);
-    void bitrv2(int n, int *ip, double *a);
-    void bitrv2conj(int n, int *ip, double *a);
-    void cftfsub(int n, double *a, double *w);
-    void cftbsub(int n, double *a, double *w);
+void cdft(int n, int isgn, smpl_t *a, int *ip, smpl_t *w)
+{
+    void makewt(int nw, int *ip, smpl_t *w);
+    void bitrv2(int n, int *ip, smpl_t *a);
+    void bitrv2conj(int n, int *ip, smpl_t *a);
+    void cftfsub(int n, smpl_t *a, smpl_t *w);
+    void cftbsub(int n, smpl_t *a, smpl_t *w);
     
     if (n > (ip[0] << 2)) {
@@ -301,15 +307,15 @@
 
 
-void rdft(int n, int isgn, double *a, int *ip, double *w)
-{
-    void makewt(int nw, int *ip, double *w);
-    void makect(int nc, int *ip, double *c);
-    void bitrv2(int n, int *ip, double *a);
-    void cftfsub(int n, double *a, double *w);
-    void cftbsub(int n, double *a, double *w);
-    void rftfsub(int n, double *a, int nc, double *c);
-    void rftbsub(int n, double *a, int nc, double *c);
+void rdft(int n, int isgn, smpl_t *a, int *ip, smpl_t *w)
+{
+    void makewt(int nw, int *ip, smpl_t *w);
+    void makect(int nc, int *ip, smpl_t *c);
+    void bitrv2(int n, int *ip, smpl_t *a);
+    void cftfsub(int n, smpl_t *a, smpl_t *w);
+    void cftbsub(int n, smpl_t *a, smpl_t *w);
+    void rftfsub(int n, smpl_t *a, int nc, smpl_t *c);
+    void rftbsub(int n, smpl_t *a, int nc, smpl_t *c);
     int nw, nc;
-    double xi;
+    smpl_t xi;
     
     nw = ip[0];
@@ -348,16 +354,16 @@
 
 
-void ddct(int n, int isgn, double *a, int *ip, double *w)
-{
-    void makewt(int nw, int *ip, double *w);
-    void makect(int nc, int *ip, double *c);
-    void bitrv2(int n, int *ip, double *a);
-    void cftfsub(int n, double *a, double *w);
-    void cftbsub(int n, double *a, double *w);
-    void rftfsub(int n, double *a, int nc, double *c);
-    void rftbsub(int n, double *a, int nc, double *c);
-    void dctsub(int n, double *a, int nc, double *c);
+void ddct(int n, int isgn, smpl_t *a, int *ip, smpl_t *w)
+{
+    void makewt(int nw, int *ip, smpl_t *w);
+    void makect(int nc, int *ip, smpl_t *c);
+    void bitrv2(int n, int *ip, smpl_t *a);
+    void cftfsub(int n, smpl_t *a, smpl_t *w);
+    void cftbsub(int n, smpl_t *a, smpl_t *w);
+    void rftfsub(int n, smpl_t *a, int nc, smpl_t *c);
+    void rftbsub(int n, smpl_t *a, int nc, smpl_t *c);
+    void dctsub(int n, smpl_t *a, int nc, smpl_t *c);
     int j, nw, nc;
-    double xr;
+    smpl_t xr;
     
     nw = ip[0];
@@ -407,16 +413,16 @@
 
 
-void ddst(int n, int isgn, double *a, int *ip, double *w)
-{
-    void makewt(int nw, int *ip, double *w);
-    void makect(int nc, int *ip, double *c);
-    void bitrv2(int n, int *ip, double *a);
-    void cftfsub(int n, double *a, double *w);
-    void cftbsub(int n, double *a, double *w);
-    void rftfsub(int n, double *a, int nc, double *c);
-    void rftbsub(int n, double *a, int nc, double *c);
-    void dstsub(int n, double *a, int nc, double *c);
+void ddst(int n, int isgn, smpl_t *a, int *ip, smpl_t *w)
+{
+    void makewt(int nw, int *ip, smpl_t *w);
+    void makect(int nc, int *ip, smpl_t *c);
+    void bitrv2(int n, int *ip, smpl_t *a);
+    void cftfsub(int n, smpl_t *a, smpl_t *w);
+    void cftbsub(int n, smpl_t *a, smpl_t *w);
+    void rftfsub(int n, smpl_t *a, int nc, smpl_t *c);
+    void rftbsub(int n, smpl_t *a, int nc, smpl_t *c);
+    void dstsub(int n, smpl_t *a, int nc, smpl_t *c);
     int j, nw, nc;
-    double xr;
+    smpl_t xr;
     
     nw = ip[0];
@@ -466,14 +472,14 @@
 
 
-void dfct(int n, double *a, double *t, int *ip, double *w)
-{
-    void makewt(int nw, int *ip, double *w);
-    void makect(int nc, int *ip, double *c);
-    void bitrv2(int n, int *ip, double *a);
-    void cftfsub(int n, double *a, double *w);
-    void rftfsub(int n, double *a, int nc, double *c);
-    void dctsub(int n, double *a, int nc, double *c);
+void dfct(int n, smpl_t *a, smpl_t *t, int *ip, smpl_t *w)
+{
+    void makewt(int nw, int *ip, smpl_t *w);
+    void makect(int nc, int *ip, smpl_t *c);
+    void bitrv2(int n, int *ip, smpl_t *a);
+    void cftfsub(int n, smpl_t *a, smpl_t *w);
+    void rftfsub(int n, smpl_t *a, int nc, smpl_t *c);
+    void dctsub(int n, smpl_t *a, int nc, smpl_t *c);
     int j, k, l, m, mh, nw, nc;
-    double xr, xi, yr, yi;
+    smpl_t xr, xi, yr, yi;
     
     nw = ip[0];
@@ -562,14 +568,14 @@
 
 
-void dfst(int n, double *a, double *t, int *ip, double *w)
-{
-    void makewt(int nw, int *ip, double *w);
-    void makect(int nc, int *ip, double *c);
-    void bitrv2(int n, int *ip, double *a);
-    void cftfsub(int n, double *a, double *w);
-    void rftfsub(int n, double *a, int nc, double *c);
-    void dstsub(int n, double *a, int nc, double *c);
+void dfst(int n, smpl_t *a, smpl_t *t, int *ip, smpl_t *w)
+{
+    void makewt(int nw, int *ip, smpl_t *w);
+    void makect(int nc, int *ip, smpl_t *c);
+    void bitrv2(int n, int *ip, smpl_t *a);
+    void cftfsub(int n, smpl_t *a, smpl_t *w);
+    void rftfsub(int n, smpl_t *a, int nc, smpl_t *c);
+    void dstsub(int n, smpl_t *a, int nc, smpl_t *c);
     int j, k, l, m, mh, nw, nc;
-    double xr, xi, yr, yi;
+    smpl_t xr, xi, yr, yi;
     
     nw = ip[0];
@@ -654,9 +660,9 @@
 #include <math.h>
 
-void makewt(int nw, int *ip, double *w)
-{
-    void bitrv2(int n, int *ip, double *a);
+void makewt(int nw, int *ip, smpl_t *w)
+{
+    void bitrv2(int n, int *ip, smpl_t *a);
     int j, nwh;
-    double delta, x, y;
+    smpl_t delta, x, y;
     
     ip[0] = nw;
@@ -690,8 +696,8 @@
 
 
-void makect(int nc, int *ip, double *c)
+void makect(int nc, int *ip, smpl_t *c)
 {
     int j, nch;
-    double delta;
+    smpl_t delta;
     
     ip[1] = nc;
@@ -712,8 +718,8 @@
 
 
-void bitrv2(int n, int *ip, double *a)
+void bitrv2(int n, int *ip, smpl_t *a)
 {
     int j, j1, k, k1, l, m, m2;
-    double xr, xi, yr, yi;
+    smpl_t xr, xi, yr, yi;
     
     ip[0] = 0;
@@ -812,8 +818,8 @@
 
 
-void bitrv2conj(int n, int *ip, double *a)
+void bitrv2conj(int n, int *ip, smpl_t *a)
 {
     int j, j1, k, k1, l, m, m2;
-    double xr, xi, yr, yi;
+    smpl_t xr, xi, yr, yi;
     
     ip[0] = 0;
@@ -921,10 +927,10 @@
 
 
-void cftfsub(int n, double *a, double *w)
-{
-    void cft1st(int n, double *a, double *w);
-    void cftmdl(int n, int l, double *a, double *w);
+void cftfsub(int n, smpl_t *a, smpl_t *w)
+{
+    void cft1st(int n, smpl_t *a, smpl_t *w);
+    void cftmdl(int n, int l, smpl_t *a, smpl_t *w);
     int j, j1, j2, j3, l;
-    double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
+    smpl_t x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i;
     
     l = 2;
@@ -973,10 +979,10 @@
 
 
-void cftbsub(int n, double *a, double *w)
-{
-    void cft1st(int n, double *a, double *w);
-    void cftmdl(int n, int l, double *a, double *w);
+void cftbsub(int n, smpl_t *a, smpl_t *w)
+{
+    void cft1st(int n, smpl_t *a, smpl_t *w);
+    void cftmdl(int n, int l, smpl_t *a, smpl_t *w);
     int j, j1, j2, j3, j4, j5, j6, j7, l;
-    double wn4r, x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, 
+    smpl_t wn4r, x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, 
         y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i, 
         y4r, y4i, y5r, y5i, y6r, y6i, y7r, y7i;
@@ -1090,10 +1096,10 @@
 
 
-void cft1st(int n, double *a, double *w)
+void cft1st(int n, smpl_t *a, smpl_t *w)
 {
     int j, k1;
-    double wn4r, wtmp, wk1r, wk1i, wk2r, wk2i, wk3r, wk3i, 
+    smpl_t wn4r, wtmp, wk1r, wk1i, wk2r, wk2i, wk3r, wk3i, 
         wk4r, wk4i, wk5r, wk5i, wk6r, wk6i, wk7r, wk7i;
-    double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, 
+    smpl_t x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, 
         y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i, 
         y4r, y4i, y5r, y5i, y6r, y6i, y7r, y7i;
@@ -1305,10 +1311,10 @@
 
 
-void cftmdl(int n, int l, double *a, double *w)
+void cftmdl(int n, int l, smpl_t *a, smpl_t *w)
 {
     int j, j1, j2, j3, j4, j5, j6, j7, k, k1, m;
-    double wn4r, wtmp, wk1r, wk1i, wk2r, wk2i, wk3r, wk3i, 
+    smpl_t wn4r, wtmp, wk1r, wk1i, wk2r, wk2i, wk3r, wk3i, 
         wk4r, wk4i, wk5r, wk5i, wk6r, wk6i, wk7r, wk7i;
-    double x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, 
+    smpl_t x0r, x0i, x1r, x1i, x2r, x2i, x3r, x3i, 
         y0r, y0i, y1r, y1i, y2r, y2i, y3r, y3i, 
         y4r, y4i, y5r, y5i, y6r, y6i, y7r, y7i;
@@ -1548,8 +1554,8 @@
 
 
-void rftfsub(int n, double *a, int nc, double *c)
+void rftfsub(int n, smpl_t *a, int nc, smpl_t *c)
 {
     int j, k, kk, ks, m;
-    double wkr, wki, xr, xi, yr, yi;
+    smpl_t wkr, wki, xr, xi, yr, yi;
     
     m = n >> 1;
@@ -1573,8 +1579,8 @@
 
 
-void rftbsub(int n, double *a, int nc, double *c)
+void rftbsub(int n, smpl_t *a, int nc, smpl_t *c)
 {
     int j, k, kk, ks, m;
-    double wkr, wki, xr, xi, yr, yi;
+    smpl_t wkr, wki, xr, xi, yr, yi;
     
     a[1] = -a[1];
@@ -1600,8 +1606,8 @@
 
 
-void dctsub(int n, double *a, int nc, double *c)
+void dctsub(int n, smpl_t *a, int nc, smpl_t *c)
 {
     int j, k, kk, ks, m;
-    double wkr, wki, xr;
+    smpl_t wkr, wki, xr;
     
     m = n >> 1;
@@ -1621,8 +1627,8 @@
 
 
-void dstsub(int n, double *a, int nc, double *c)
+void dstsub(int n, smpl_t *a, int nc, smpl_t *c)
 {
     int j, k, kk, ks, m;
-    double wkr, wki, xr;
+    smpl_t wkr, wki, xr;
     
     m = n >> 1;
