projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
df66c37
)
[py] musicutils also use Pyfloat_FromDouble
author
Paul Brossier
<piem@piem.org>
Wed, 19 Dec 2018 16:14:59 +0000
(17:14 +0100)
committer
Paul Brossier
<piem@piem.org>
Wed, 19 Dec 2018 16:14:59 +0000
(17:14 +0100)
python/ext/py-musicutils.c
patch
|
blob
|
history
diff --git
a/python/ext/py-musicutils.c
b/python/ext/py-musicutils.c
index
3d90daf
..
0827ea2
100644
(file)
--- 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;
}
return NULL;
}
- level_lin = Py
_BuildValue(AUBIO_NPY_SMPL_CHR,
aubio_level_lin(&vec));
+ level_lin = Py
Float_FromDouble(
aubio_level_lin(&vec));
if (level_lin == NULL) {
PyErr_SetString (PyExc_ValueError, "failed computing level_lin");
return NULL;
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;
}
return NULL;
}
- db_spl = Py
_BuildValue(AUBIO_NPY_SMPL_CHR,
aubio_db_spl(&vec));
+ db_spl = Py
Float_FromDouble(
aubio_db_spl(&vec));
if (db_spl == NULL) {
PyErr_SetString (PyExc_ValueError, "failed computing db_spl");
return NULL;
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;
}
return NULL;
}
- silence_detection = Py
_BuildValue("I",
aubio_silence_detection(&vec, threshold));
+ silence_detection = Py
Long_FromLong(
aubio_silence_detection(&vec, threshold));
if (silence_detection == NULL) {
PyErr_SetString (PyExc_ValueError, "failed computing silence_detection");
return NULL;
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;
}
return NULL;
}
- level_detection = Py
_BuildValue(AUBIO_NPY_SMPL_CHR,
aubio_level_detection(&vec, threshold));
+ level_detection = Py
Float_FromDouble(
aubio_level_detection(&vec, threshold));
if (level_detection == NULL) {
PyErr_SetString (PyExc_ValueError, "failed computing level_detection");
return NULL;
if (level_detection == NULL) {
PyErr_SetString (PyExc_ValueError, "failed computing level_detection");
return NULL;