From: Paul Brossier Date: Wed, 19 Dec 2018 16:14:59 +0000 (+0100) Subject: [py] musicutils also use Pyfloat_FromDouble X-Git-Tag: 0.4.9~72 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=a617bf31cb29614eae92649034696100726ba87d;p=aubio.git [py] musicutils also use Pyfloat_FromDouble --- diff --git a/python/ext/py-musicutils.c b/python/ext/py-musicutils.c index 3d90dafd..0827ea24 100644 --- a/python/ext/py-musicutils.c +++ b/python/ext/py-musicutils.c @@ -39,7 +39,7 @@ Py_aubio_level_lin(PyObject *self, PyObject *args) return NULL; } - level_lin = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_level_lin(&vec)); + level_lin = PyFloat_FromDouble(aubio_level_lin(&vec)); if (level_lin == NULL) { PyErr_SetString (PyExc_ValueError, "failed computing level_lin"); return NULL; @@ -67,7 +67,7 @@ Py_aubio_db_spl(PyObject *self, PyObject *args) return NULL; } - db_spl = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_db_spl(&vec)); + db_spl = PyFloat_FromDouble(aubio_db_spl(&vec)); if (db_spl == NULL) { PyErr_SetString (PyExc_ValueError, "failed computing db_spl"); return NULL; @@ -96,7 +96,7 @@ Py_aubio_silence_detection(PyObject *self, PyObject *args) return NULL; } - silence_detection = Py_BuildValue("I", aubio_silence_detection(&vec, threshold)); + silence_detection = PyLong_FromLong(aubio_silence_detection(&vec, threshold)); if (silence_detection == NULL) { PyErr_SetString (PyExc_ValueError, "failed computing silence_detection"); return NULL; @@ -125,7 +125,7 @@ Py_aubio_level_detection(PyObject *self, PyObject *args) return NULL; } - level_detection = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_level_detection(&vec, threshold)); + level_detection = PyFloat_FromDouble(aubio_level_detection(&vec, threshold)); if (level_detection == NULL) { PyErr_SetString (PyExc_ValueError, "failed computing level_detection"); return NULL;