ref: a617bf31cb29614eae92649034696100726ba87d
parent: df66c37332ff738b6430a543f9bffb818ffe9d1d
author: Paul Brossier <piem@piem.org>
date: Wed Dec 19 12:14:59 EST 2018
[py] musicutils also use Pyfloat_FromDouble
--- a/python/ext/py-musicutils.c
+++ b/python/ext/py-musicutils.c
@@ -39,7 +39,7 @@
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 @@
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 @@
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 @@
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;