Index: python/ext/aubio-types.h
===================================================================
--- python/ext/aubio-types.h	(revision 81984a7ad7ed58837b0ca07cdd6098b1838ca2b8)
+++ python/ext/aubio-types.h	(revision c6388f4affa69eb201fa5de663dd8d27fef12b74)
@@ -34,8 +34,12 @@
 
 #if HAVE_AUBIO_DOUBLE
-#error "Ouch! Python interface for aubio has not been much tested yet."
+#warning "double mode needs love"
 #define AUBIO_NPY_SMPL NPY_DOUBLE
+#define AUBIO_NPY_SMPL_STR "float64"
+#define AUBIO_NPY_SMPL_CHR "d"
 #else
 #define AUBIO_NPY_SMPL NPY_FLOAT
+#define AUBIO_NPY_SMPL_STR "float32"
+#define AUBIO_NPY_SMPL_CHR "f"
 #endif
 
Index: python/ext/aubiomodule.c
===================================================================
--- python/ext/aubiomodule.c	(revision 81984a7ad7ed58837b0ca07cdd6098b1838ca2b8)
+++ python/ext/aubiomodule.c	(revision c6388f4affa69eb201fa5de663dd8d27fef12b74)
@@ -88,5 +88,5 @@
   PyObject *result;
 
-  if (!PyArg_ParseTuple (args, "Of:alpha_norm", &input, &alpha)) {
+  if (!PyArg_ParseTuple (args, "O" AUBIO_NPY_SMPL_CHR ":alpha_norm", &input, &alpha)) {
     return NULL;
   }
@@ -101,5 +101,5 @@
 
   // compute the function
-  result = Py_BuildValue ("f", fvec_alpha_norm (&vec, alpha));
+  result = Py_BuildValue (AUBIO_NPY_SMPL_CHR, fvec_alpha_norm (&vec, alpha));
   if (result == NULL) {
     return NULL;
@@ -115,5 +115,5 @@
   smpl_t output;
 
-  if (!PyArg_ParseTuple (args, "|fff", &input, &samplerate, &fftsize)) {
+  if (!PyArg_ParseTuple (args, "|" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR , &input, &samplerate, &fftsize)) {
     return NULL;
   }
@@ -130,5 +130,5 @@
   smpl_t output;
 
-  if (!PyArg_ParseTuple (args, "|fff", &input, &samplerate, &fftsize)) {
+  if (!PyArg_ParseTuple (args, "|" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR , &input, &samplerate, &fftsize)) {
     return NULL;
   }
@@ -145,5 +145,5 @@
   smpl_t output;
 
-  if (!PyArg_ParseTuple (args, "|fff", &input, &samplerate, &fftsize)) {
+  if (!PyArg_ParseTuple (args, "|" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR, &input, &samplerate, &fftsize)) {
     return NULL;
   }
@@ -160,5 +160,5 @@
   smpl_t output;
 
-  if (!PyArg_ParseTuple (args, "|fff", &input, &samplerate, &fftsize)) {
+  if (!PyArg_ParseTuple (args, "|" AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR AUBIO_NPY_SMPL_CHR, &input, &samplerate, &fftsize)) {
     return NULL;
   }
@@ -189,5 +189,5 @@
 
   // compute the function
-  result = Py_BuildValue ("f", aubio_zero_crossing_rate (&vec));
+  result = Py_BuildValue (AUBIO_NPY_SMPL_CHR, aubio_zero_crossing_rate (&vec));
   if (result == NULL) {
     return NULL;
@@ -309,4 +309,6 @@
   PyModule_AddObject (m, "sink", (PyObject *) & Py_sinkType);
 
+  PyModule_AddStringConstant(m, "float_type", AUBIO_NPY_SMPL_STR);
+
   // add generated objects
   add_generated_objects(m);
Index: python/ext/aubioproxy.c
===================================================================
--- python/ext/aubioproxy.c	(revision 81984a7ad7ed58837b0ca07cdd6098b1838ca2b8)
+++ python/ext/aubioproxy.c	(revision c6388f4affa69eb201fa5de663dd8d27fef12b74)
@@ -31,5 +31,5 @@
       return 0;
     } else if (PyArray_TYPE ((PyArrayObject *)input) != AUBIO_NPY_SMPL) {
-      PyErr_SetString (PyExc_ValueError, "input array should be float32");
+      PyErr_SetString (PyExc_ValueError, "input array should be " AUBIO_NPY_SMPL_STR);
       return 0;
     }
@@ -74,5 +74,5 @@
       return 1;
   } else {
-      PyErr_SetString (PyExc_ValueError, "input array should be float32");
+      PyErr_SetString (PyExc_ValueError, "input array should be aubio.cvec");
       return 0;
   }
@@ -120,5 +120,5 @@
       return 0;
     } else if (PyArray_TYPE ((PyArrayObject *)input) != AUBIO_NPY_SMPL) {
-      PyErr_SetString (PyExc_ValueError, "input array should be float32");
+      PyErr_SetString (PyExc_ValueError, "input array should be " AUBIO_NPY_SMPL_STR);
       return 0;
     }
Index: python/ext/py-cvec.c
===================================================================
--- python/ext/py-cvec.c	(revision 81984a7ad7ed58837b0ca07cdd6098b1838ca2b8)
+++ python/ext/py-cvec.c	(revision c6388f4affa69eb201fa5de663dd8d27fef12b74)
@@ -94,5 +94,5 @@
 {
   npy_intp dims[] = { self->o->length, 1 };
-  return PyArray_SimpleNewFromData (1, dims, NPY_FLOAT, self->o->norm);
+  return PyArray_SimpleNewFromData (1, dims, AUBIO_NPY_SMPL, self->o->norm);
 }
 
@@ -102,5 +102,5 @@
 {
   npy_intp dims[] = { self->o->length, 1 };
-  return PyArray_SimpleNewFromData (1, dims, NPY_FLOAT, self->o->phas);
+  return PyArray_SimpleNewFromData (1, dims, AUBIO_NPY_SMPL, self->o->phas);
 }
 
Index: python/ext/py-musicutils.c
===================================================================
--- python/ext/py-musicutils.c	(revision 81984a7ad7ed58837b0ca07cdd6098b1838ca2b8)
+++ python/ext/py-musicutils.c	(revision c6388f4affa69eb201fa5de663dd8d27fef12b74)
@@ -42,5 +42,5 @@
   }
 
-  level_lin = Py_BuildValue("f", aubio_level_lin(&vec));
+  level_lin = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_level_lin(&vec));
   if (level_lin == NULL) {
     PyErr_SetString (PyExc_ValueError, "failed computing level_lin");
@@ -71,5 +71,5 @@
   }
 
-  db_spl = Py_BuildValue("f", aubio_db_spl(&vec));
+  db_spl = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_db_spl(&vec));
   if (db_spl == NULL) {
     PyErr_SetString (PyExc_ValueError, "failed computing db_spl");
@@ -88,5 +88,5 @@
   smpl_t threshold;
 
-  if (!PyArg_ParseTuple (args, "Of:silence_detection", &input, &threshold)) {
+  if (!PyArg_ParseTuple (args, "O" AUBIO_NPY_SMPL_CHR ":silence_detection", &input, &threshold)) {
     PyErr_SetString (PyExc_ValueError, "failed parsing arguments");
     return NULL;
@@ -118,5 +118,5 @@
   smpl_t threshold;
 
-  if (!PyArg_ParseTuple (args, "Of:level_detection", &input, &threshold)) {
+  if (!PyArg_ParseTuple (args, "O" AUBIO_NPY_SMPL_CHR ":level_detection", &input, &threshold)) {
     PyErr_SetString (PyExc_ValueError, "failed parsing arguments");
     return NULL;
@@ -131,5 +131,5 @@
   }
 
-  level_detection = Py_BuildValue("f", aubio_level_detection(&vec, threshold));
+  level_detection = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_level_detection(&vec, threshold));
   if (level_detection == NULL) {
     PyErr_SetString (PyExc_ValueError, "failed computing level_detection");
Index: python/lib/gen_code.py
===================================================================
--- python/lib/gen_code.py	(revision 81984a7ad7ed58837b0ca07cdd6098b1838ca2b8)
+++ python/lib/gen_code.py	(revision c6388f4affa69eb201fa5de663dd8d27fef12b74)
@@ -26,5 +26,5 @@
         'char_t*': 'T_STRING',
         'uint_t': 'T_INT',
-        'smpl_t': 'T_FLOAT',
+        'smpl_t': 'AUBIO_NPY_SMPL',
         }
 
