Index: python/tests/test_filterbank.py
===================================================================
--- python/tests/test_filterbank.py	(revision fbcee4fde322612474a48791b3b7f00dcb6d4888)
+++ python/tests/test_filterbank.py	(revision c4b2183510f37285509236ed14bdff7f4e3c6957)
@@ -6,5 +6,5 @@
 from math import pi
 from numpy import array
-from aubio import cvec, filterbank
+from aubio import cvec, filterbank, float_type
 from utils import array_from_text_file
 
@@ -17,5 +17,5 @@
   def test_set_coeffs(self):
     f = filterbank(40, 512)
-    r = random.random([40, int(512 / 2) + 1]).astype('float32')
+    r = random.random([40, int(512 / 2) + 1]).astype(float_type)
     f.set_coeffs(r)
     assert_equal (r, f.get_coeffs())
@@ -36,5 +36,5 @@
     f = filterbank(40, 512)
     c = cvec(512)
-    c.norm[:] = random.random((int(512 / 2) + 1,)).astype('float32')
+    c.norm[:] = random.random((int(512 / 2) + 1,)).astype(float_type)
     assert_equal( f(c), 0)
 
@@ -42,8 +42,8 @@
     f = filterbank(40, 512)
     c = cvec(512)
-    r = random.random([40, int(512 / 2) + 1]).astype('float32')
+    r = random.random([40, int(512 / 2) + 1]).astype(float_type)
     r /= r.sum()
     f.set_coeffs(r)
-    c.norm[:] = random.random((int(512 / 2) + 1,)).astype('float32')
+    c.norm[:] = random.random((int(512 / 2) + 1,)).astype(float_type)
     assert_equal ( f(c) < 1., True )
     assert_equal ( f(c) > 0., True )
@@ -53,5 +53,5 @@
     c = cvec(512)
     f.set_mel_coeffs_slaney(44100)
-    c.norm[:] = random.random((int(512 / 2) + 1,)).astype('float32')
+    c.norm[:] = random.random((int(512 / 2) + 1,)).astype(float_type)
     assert_equal ( f(c) < 1., True )
     assert_equal ( f(c) > 0., True )
Index: python/tests/test_filterbank_mel.py
===================================================================
--- python/tests/test_filterbank_mel.py	(revision fbcee4fde322612474a48791b3b7f00dcb6d4888)
+++ python/tests/test_filterbank_mel.py	(revision c4b2183510f37285509236ed14bdff7f4e3c6957)
@@ -4,5 +4,5 @@
 from numpy.testing import assert_equal, assert_almost_equal
 from numpy import array, shape
-from aubio import cvec, filterbank
+from aubio import cvec, filterbank, float_type
 
 class aubio_filterbank_mel_test_case(TestCase):
@@ -28,5 +28,5 @@
     f = filterbank(9, 1024)
     freq_list = [40, 80, 200, 400, 800, 1600, 3200, 6400, 12800, 15000, 24000]
-    freqs = array(freq_list, dtype = 'float32')
+    freqs = array(freq_list, dtype = float_type)
     f.set_triangle_bands(freqs, 48000)
     f.get_coeffs().T
@@ -36,5 +36,5 @@
     f = filterbank(9, 1024)
     freq_list = [40, 80, 200, 400, 800, 1600, 3200, 6400, 12800, 15000, 24000]
-    freqs = array(freq_list, dtype = 'float32')
+    freqs = array(freq_list, dtype = float_type)
     f.set_triangle_bands(freqs, 48000)
     f.get_coeffs().T
Index: python/tests/test_fvec.py
===================================================================
--- python/tests/test_fvec.py	(revision fbcee4fde322612474a48791b3b7f00dcb6d4888)
+++ python/tests/test_fvec.py	(revision c4b2183510f37285509236ed14bdff7f4e3c6957)
@@ -4,5 +4,8 @@
 from numpy.testing import assert_equal, assert_almost_equal
 from aubio import fvec, zero_crossing_rate, alpha_norm, min_removal
+from aubio import float_type
 from numpy import array, shape
+
+wrong_type = 'float32' if float_type == 'float64' else 'float64'
 
 default_size = 512
@@ -12,5 +15,5 @@
     def test_vector_created_with_zeroes(self):
         a = fvec(10)
-        assert a.dtype == 'float32'
+        assert a.dtype == float_type
         assert a.shape == (10,)
         assert_equal (a, 0)
@@ -18,5 +21,5 @@
     def test_vector_create_with_list(self):
         a = fvec([0,1,2,3])
-        assert a.dtype == 'float32'
+        assert a.dtype == float_type
         assert a.shape == (4,)
         assert_equal (list(range(4)), a)
@@ -58,5 +61,5 @@
         a[1] = 1
         self.assertEqual (alpha_norm(a, 1), 1)
-        a = array([0, 1], dtype='float32')
+        a = array([0, 1], dtype=float_type)
         from math import sqrt
         assert_almost_equal (alpha_norm(a, 2), sqrt(2)/2.)
@@ -67,11 +70,11 @@
     def test_alpha_norm_of_array_of_float32(self):
         # check scalar fails
-        a = array(1, dtype = 'float32')
+        a = array(1, dtype = float_type)
         self.assertRaises (ValueError, alpha_norm, a, 1)
         # check 2d array fails
-        a = array([[2],[4]], dtype = 'float32')
+        a = array([[2],[4]], dtype = float_type)
         self.assertRaises (ValueError, alpha_norm, a, 1)
         # check 1d array
-        a = array(range(10), dtype = 'float32')
+        a = array(range(10), dtype = float_type)
         self.assertEqual (alpha_norm(a, 1), 4.5)
 
@@ -89,29 +92,29 @@
 
     def test_zero_crossing_rate(self):
-        a = array([0,1,-1], dtype='float32')
+        a = array([0,1,-1], dtype=float_type)
         assert_almost_equal (zero_crossing_rate(a), 1./3. )
-        a = array([0.]*100, dtype='float32')
+        a = array([0.]*100, dtype=float_type)
         self.assertEqual (zero_crossing_rate(a), 0 )
-        a = array([-1.]*100, dtype='float32')
+        a = array([-1.]*100, dtype=float_type)
         self.assertEqual (zero_crossing_rate(a), 0 )
-        a = array([1.]*100, dtype='float32')
+        a = array([1.]*100, dtype=float_type)
         self.assertEqual (zero_crossing_rate(a), 0 )
 
     def test_alpha_norm_of_array_of_float64(self):
         # check scalar fail
-        a = array(1, dtype = 'float64')
+        a = array(1, dtype = wrong_type)
         self.assertRaises (ValueError, alpha_norm, a, 1)
         # check 3d array fail
-        a = array([[[1,2],[3,4]]], dtype = 'float64')
+        a = array([[[1,2],[3,4]]], dtype = wrong_type)
         self.assertRaises (ValueError, alpha_norm, a, 1)
         # check float64 1d array fail
-        a = array(list(range(10)), dtype = 'float64')
+        a = array(list(range(10)), dtype = wrong_type)
         self.assertRaises (ValueError, alpha_norm, a, 1)
         # check float64 2d array fail
-        a = array([list(range(10)), list(range(10))], dtype = 'float64')
+        a = array([list(range(10)), list(range(10))], dtype = wrong_type)
         self.assertRaises (ValueError, alpha_norm, a, 1)
 
     def test_fvec_min_removal_of_array(self):
-        a = array([20,1,19], dtype='float32')
+        a = array([20,1,19], dtype=float_type)
         b = min_removal(a)
         assert_equal (array(b), [19, 0, 18])
@@ -122,10 +125,10 @@
 
     def test_fvec_min_removal_of_array_float64(self):
-        a = array([20,1,19], dtype='float64')
+        a = array([20,1,19], dtype=wrong_type)
         self.assertRaises (ValueError, min_removal, a)
 
     def test_fvec_min_removal_of_fvec(self):
         a = fvec(3)
-        a = array([20, 1, 19], dtype = 'float32')
+        a = array([20, 1, 19], dtype = float_type)
         b = min_removal(a)
         assert_equal (array(b), [19, 0, 18])
Index: python/tests/test_musicutils.py
===================================================================
--- python/tests/test_musicutils.py	(revision fbcee4fde322612474a48791b3b7f00dcb6d4888)
+++ python/tests/test_musicutils.py	(revision c4b2183510f37285509236ed14bdff7f4e3c6957)
@@ -8,5 +8,5 @@
 from aubio import window, level_lin, db_spl, silence_detection, level_detection
 
-from aubio import fvec
+from aubio import fvec, float_type
 
 class aubio_window(TestCase):
@@ -54,5 +54,5 @@
     def test_minus_ones_is_one(self):
         from numpy import ones
-        assert_equal(level_lin(-ones(1024, dtype="float32")), 1.)
+        assert_equal(level_lin(-ones(1024, dtype = float_type)), 1.)
 
 class aubio_db_spl(TestCase):
@@ -74,5 +74,5 @@
     def test_minus_ones_is_zero(self):
         from numpy import ones
-        assert_equal(db_spl(-ones(1024, dtype="float32")), 0.)
+        assert_equal(db_spl(-ones(1024, dtype = float_type)), 0.)
 
 class aubio_silence_detection(TestCase):
@@ -94,5 +94,5 @@
     def test_minus_ones_is_zero(self):
         from numpy import ones
-        assert silence_detection(ones(1024, dtype="float32"), -70) == 0
+        assert silence_detection(ones(1024, dtype = float_type), -70) == 0
 
 class aubio_level_detection(TestCase):
@@ -114,5 +114,5 @@
     def test_minus_ones_is_zero(self):
         from numpy import ones
-        assert level_detection(ones(1024, dtype="float32"), -70) == 0
+        assert level_detection(ones(1024, dtype = float_type), -70) == 0
 
 if __name__ == '__main__':
Index: python/tests/test_pitch.py
===================================================================
--- python/tests/test_pitch.py	(revision fbcee4fde322612474a48791b3b7f00dcb6d4888)
+++ python/tests/test_pitch.py	(revision c4b2183510f37285509236ed14bdff7f4e3c6957)
@@ -5,5 +5,5 @@
 from numpy import random, sin, arange, mean, median, isnan
 from math import pi
-from aubio import fvec, pitch, freqtomidi
+from aubio import fvec, pitch, freqtomidi, float_type
 
 class aubio_pitch_Good_Values(TestCase):
@@ -51,5 +51,5 @@
 
     def build_sinusoid(self, length, freq, samplerate):
-        return sin( 2. * pi * arange(length).astype('float32') * freq / samplerate)
+        return sin( 2. * pi * arange(length).astype(float_type) * freq / samplerate)
 
     def run_pitch(self, p, input_vec, freq):
Index: python/tests/test_specdesc.py
===================================================================
--- python/tests/test_specdesc.py	(revision fbcee4fde322612474a48791b3b7f00dcb6d4888)
+++ python/tests/test_specdesc.py	(revision c4b2183510f37285509236ed14bdff7f4e3c6957)
@@ -3,5 +3,5 @@
 from numpy.testing import TestCase, assert_equal, assert_almost_equal
 from numpy import random, arange, log, zeros
-from aubio import specdesc, cvec
+from aubio import specdesc, cvec, float_type
 from math import pi
 
@@ -38,6 +38,6 @@
           #print "%20s" % method, str(o(spec))
           o(spec)
-          spec.norm = random.random_sample((len(spec.norm),)).astype('float32')
-          spec.phas = random.random_sample((len(spec.phas),)).astype('float32')
+          spec.norm = random.random_sample((len(spec.norm),)).astype(float_type)
+          spec.phas = random.random_sample((len(spec.phas),)).astype(float_type)
           #print "%20s" % method, str(o(spec))
           assert (o(spec) != 0.)
@@ -61,5 +61,5 @@
         # phase of zeros is zero
         assert_equal (o(spec), 0.)
-        spec.phas = random.random_sample((len(spec.phas),)).astype('float32')
+        spec.phas = random.random_sample((len(spec.phas),)).astype(float_type)
         # phase of random is not zero
         spec.norm[:] = 1
@@ -71,5 +71,5 @@
         # specdiff of zeros is zero
         assert_equal (o(spec), 0.)
-        spec.phas = random.random_sample((len(spec.phas),)).astype('float32')
+        spec.phas = random.random_sample((len(spec.phas),)).astype(float_type)
         # phase of random is not zero
         spec.norm[:] = 1
@@ -80,5 +80,5 @@
         c = cvec()
         assert_equal( 0., o(c))
-        a = arange(c.length, dtype='float32')
+        a = arange(c.length, dtype=float_type)
         c.norm = a
         assert_equal (a, c.norm)
@@ -89,5 +89,5 @@
         c = cvec()
         assert_equal( 0., o(c))
-        a = arange(c.length, dtype='float32')
+        a = arange(c.length, dtype=float_type)
         c.norm = a
         assert_equal (a, c.norm)
@@ -102,5 +102,5 @@
         c = cvec()
         assert_equal( 0., o(c))
-        a = arange(c.length, dtype='float32')
+        a = arange(c.length, dtype=float_type)
         c.norm = a
         assert_almost_equal( sum(a * log(1.+ a/1.e-1 ) ) / o(c), 1., decimal=6)
@@ -110,5 +110,5 @@
         c = cvec()
         assert_equal( 0., o(c))
-        a = arange(c.length, dtype='float32')
+        a = arange(c.length, dtype=float_type)
         c.norm = a
         assert_almost_equal( sum(log(1.+ a/1.e-1 ) ) / o(c), 1, decimal=6)
@@ -118,9 +118,9 @@
         c = cvec()
         assert_equal( 0., o(c))
-        a = arange(c.length, dtype='float32')
+        a = arange(c.length, dtype=float_type)
         c.norm = a
         assert_equal( sum(a), o(c))
         assert_equal( 0, o(c))
-        c.norm = zeros(c.length, dtype='float32')
+        c.norm = zeros(c.length, dtype=float_type)
         assert_equal( 0, o(c))
 
@@ -130,5 +130,5 @@
         # make sure centroid of zeros is zero
         assert_equal( 0., o(c))
-        a = arange(c.length, dtype='float32')
+        a = arange(c.length, dtype=float_type)
         c.norm = a
         centroid = sum(a*a) / sum(a)
@@ -141,5 +141,5 @@
         o = specdesc("spread")
         c = cvec(2048)
-        ramp = arange(c.length, dtype='float32')
+        ramp = arange(c.length, dtype=float_type)
         assert_equal( 0., o(c))
 
@@ -154,5 +154,5 @@
         c = cvec()
         assert_equal( 0., o(c))
-        a = arange(c.length, dtype='float32')
+        a = arange(c.length, dtype=float_type)
         c.norm = a
         centroid = sum(a*a) / sum(a)
@@ -168,5 +168,5 @@
         c = cvec()
         assert_equal( 0., o(c))
-        a = arange(c.length, dtype='float32')
+        a = arange(c.length, dtype=float_type)
         c.norm = a
         centroid = sum(a*a) / sum(a)
@@ -179,6 +179,6 @@
         c = cvec()
         assert_equal( 0., o(c))
-        a = arange(c.length * 2, 0, -2, dtype='float32')
-        k = arange(c.length, dtype='float32')
+        a = arange(c.length * 2, 0, -2, dtype=float_type)
+        k = arange(c.length, dtype=float_type)
         c.norm = a
         num = len(a) * sum(k*a) - sum(k)*sum(a)
@@ -187,5 +187,5 @@
         assert_almost_equal (slope, o(c), decimal = 5)
 
-        a = arange(0, c.length * 2, +2, dtype='float32')
+        a = arange(0, c.length * 2, +2, dtype=float_type)
         c.norm = a
         num = len(a) * sum(k*a) - sum(k)*sum(a)
@@ -194,5 +194,5 @@
         assert_almost_equal (slope, o(c), decimal = 5)
 
-        a = arange(0, c.length * 2, +2, dtype='float32')
+        a = arange(0, c.length * 2, +2, dtype=float_type)
         c.norm = a * 2
         assert_almost_equal (slope, o(c), decimal = 5)
@@ -202,16 +202,16 @@
         c = cvec()
         assert_equal( 0., o(c))
-        a = arange(c.length * 2, 0, -2, dtype='float32')
-        k = arange(c.length, dtype='float32')
+        a = arange(c.length * 2, 0, -2, dtype=float_type)
+        k = arange(c.length, dtype=float_type)
         c.norm = a
         decrease = sum((a[1:] - a [0]) / k[1:]) / sum(a[1:]) 
         assert_almost_equal (decrease, o(c), decimal = 5)
 
-        a = arange(0, c.length * 2, +2, dtype='float32')
+        a = arange(0, c.length * 2, +2, dtype=float_type)
         c.norm = a
         decrease = sum((a[1:] - a [0]) / k[1:]) / sum(a[1:]) 
         assert_almost_equal (decrease, o(c), decimal = 5)
 
-        a = arange(0, c.length * 2, +2, dtype='float32')
+        a = arange(0, c.length * 2, +2, dtype=float_type)
         c.norm = a * 2
         decrease = sum((a[1:] - a [0]) / k[1:]) / sum(a[1:]) 
@@ -222,6 +222,6 @@
         c = cvec()
         assert_equal( 0., o(c))
-        a = arange(c.length * 2, 0, -2, dtype='float32')
-        k = arange(c.length, dtype='float32')
+        a = arange(c.length * 2, 0, -2, dtype=float_type)
+        k = arange(c.length, dtype=float_type)
         c.norm = a
         cumsum = .95*sum(a*a)
