| @@ -39,7 +39,7 @@ Py_aubio_level_lin(PyObject *self, PyObject *args) · 38 unmodified lines |
| 39 | return NULL; | 39 | return NULL; |
| 40 | } | 40 | } |
| 41 | | 41 | |
| 42 | level_lin = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_level_lin(&vec)); | 42 | level_lin = PyFloat_FromDouble(aubio_level_lin(&vec)); |
| 43 | if (level_lin == NULL) { | 43 | if (level_lin == NULL) { |
| 44 | PyErr_SetString (PyExc_ValueError, "failed computing level_lin"); | 44 | PyErr_SetString (PyExc_ValueError, "failed computing level_lin"); |
| 45 | return NULL; | 45 | return NULL; |
| @@ -67,7 +67,7 @@ Py_aubio_db_spl(PyObject *self, PyObject *args) · 21 unmodified lines |
| 67 | return NULL; | 67 | return NULL; |
| 68 | } | 68 | } |
| 69 | | 69 | |
| 70 | db_spl = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_db_spl(&vec)); | 70 | db_spl = PyFloat_FromDouble(aubio_db_spl(&vec)); |
| 71 | if (db_spl == NULL) { | 71 | if (db_spl == NULL) { |
| 72 | PyErr_SetString (PyExc_ValueError, "failed computing db_spl"); | 72 | PyErr_SetString (PyExc_ValueError, "failed computing db_spl"); |
| 73 | return NULL; | 73 | return NULL; |
| @@ -96,7 +96,7 @@ Py_aubio_silence_detection(PyObject *self, PyObject *args) · 22 unmodified lines |
| 96 | return NULL; | 96 | return NULL; |
| 97 | } | 97 | } |
| 98 | | 98 | |
| 99 | silence_detection = Py_BuildValue("I", aubio_silence_detection(&vec, threshold)); | 99 | silence_detection = PyLong_FromLong(aubio_silence_detection(&vec, threshold)); |
| 100 | if (silence_detection == NULL) { | 100 | if (silence_detection == NULL) { |
| 101 | PyErr_SetString (PyExc_ValueError, "failed computing silence_detection"); | 101 | PyErr_SetString (PyExc_ValueError, "failed computing silence_detection"); |
| 102 | return NULL; | 102 | return NULL; |
| @@ -125,7 +125,7 @@ Py_aubio_level_detection(PyObject *self, PyObject *args) · 22 unmodified lines |
| 125 | return NULL; | 125 | return NULL; |
| 126 | } | 126 | } |
| 127 | | 127 | |
| 128 | level_detection = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_level_detection(&vec, threshold)); | 128 | level_detection = PyFloat_FromDouble(aubio_level_detection(&vec, threshold)); |
| 129 | if (level_detection == NULL) { | 129 | if (level_detection == NULL) { |
| 130 | PyErr_SetString (PyExc_ValueError, "failed computing level_detection"); | 130 | PyErr_SetString (PyExc_ValueError, "failed computing level_detection"); |
| 131 | return NULL; | 131 | return NULL; |
| @@ -194,9 +194,9 @@ Py_aubio_hztomel(PyObject *self, PyObject *args, PyObject *kwds) · 62 unmodified lines |
| 194 | return NULL; | 194 | return NULL; |
| 195 | } | 195 | } |
| 196 | if (htk != NULL && PyObject_IsTrue(htk) == 1) | 196 | if (htk != NULL && PyObject_IsTrue(htk) == 1) |
| 197 | return Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_hztomel_htk(v)); | 197 | return PyFloat_FromDouble(aubio_hztomel_htk(v)); |
| 198 | else | 198 | else |
| 199 | return Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_hztomel(v)); | 199 | return PyFloat_FromDouble(aubio_hztomel(v)); |
| 200 | } | 200 | } |
| 201 | | 201 | |
| 202 | PyObject* | 202 | PyObject* |
| @@ -211,9 +211,9 @@ Py_aubio_meltohz(PyObject *self, PyObject *args, PyObject *kwds) · 8 unmodified lines |
| 211 | return NULL; | 211 | return NULL; |
| 212 | } | 212 | } |
| 213 | if (htk != NULL && PyObject_IsTrue(htk) == 1) | 213 | if (htk != NULL && PyObject_IsTrue(htk) == 1) |
| 214 | return Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_meltohz_htk(v)); | 214 | return PyFloat_FromDouble(aubio_meltohz_htk(v)); |
| 215 | else | 215 | else |
| 216 | return Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_meltohz(v)); | 216 | return PyFloat_FromDouble(aubio_meltohz(v)); |
| 217 | } | 217 | } |
| 218 | | 218 | |
| 219 | PyObject* | 219 | PyObject* |
| @@ -223,7 +223,7 @@ Py_aubio_hztomel_htk(PyObject *self, PyObject *args) · 3 unmodified lines |
| 223 | if (!PyArg_ParseTuple(args, AUBIO_NPY_SMPL_CHR, &v)) { | 223 | if (!PyArg_ParseTuple(args, AUBIO_NPY_SMPL_CHR, &v)) { |
| 224 | return NULL; | 224 | return NULL; |
| 225 | } | 225 | } |
| 226 | return Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_hztomel_htk(v)); | 226 | return PyFloat_FromDouble(aubio_hztomel_htk(v)); |
| 227 | } | 227 | } |
| 228 | | 228 | |
| 229 | PyObject* | 229 | PyObject* |
| @@ -233,5 +233,5 @@ Py_aubio_meltohz_htk(PyObject *self, PyObject *args) · 3 unmodified lines |
| 233 | if (!PyArg_ParseTuple(args, AUBIO_NPY_SMPL_CHR, &v)) { | 233 | if (!PyArg_ParseTuple(args, AUBIO_NPY_SMPL_CHR, &v)) { |
| 234 | return NULL; | 234 | return NULL; |
| 235 | } | 235 | } |
| 236 | return Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_meltohz_htk(v)); | 236 | return PyFloat_FromDouble(aubio_meltohz_htk(v)); |
| 237 | } | 237 | } |