History

[py] musicutils also use Pyfloat_FromDouble

Paul Brossier committed 7 years ago

Commit a617bf31 parent df66c371 file · +4 −4Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/ext/py-musicutils.c+4−4
@@ -39,7 +39,7 @@ Py_aubio_level_lin(PyObject *self, PyObject *args) · 38 unmodified lines
3939 return NULL;
4040 }
4141
42− level_lin = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_level_lin(&vec));
42+ level_lin = PyFloat_FromDouble(aubio_level_lin(&vec));
4343 if (level_lin == NULL) {
4444 PyErr_SetString (PyExc_ValueError, "failed computing level_lin");
4545 return NULL;
@@ -67,7 +67,7 @@ Py_aubio_db_spl(PyObject *self, PyObject *args) · 21 unmodified lines
6767 return NULL;
6868 }
6969
70− db_spl = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_db_spl(&vec));
70+ db_spl = PyFloat_FromDouble(aubio_db_spl(&vec));
7171 if (db_spl == NULL) {
7272 PyErr_SetString (PyExc_ValueError, "failed computing db_spl");
7373 return NULL;
@@ -96,7 +96,7 @@ Py_aubio_silence_detection(PyObject *self, PyObject *args) · 22 unmodified lines
9696 return NULL;
9797 }
9898
99− silence_detection = Py_BuildValue("I", aubio_silence_detection(&vec, threshold));
99+ silence_detection = PyLong_FromLong(aubio_silence_detection(&vec, threshold));
100100 if (silence_detection == NULL) {
101101 PyErr_SetString (PyExc_ValueError, "failed computing silence_detection");
102102 return NULL;
@@ -125,7 +125,7 @@ Py_aubio_level_detection(PyObject *self, PyObject *args) · 22 unmodified lines
125125 return NULL;
126126 }
127127
128− level_detection = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_level_detection(&vec, threshold));
128+ level_detection = PyFloat_FromDouble(aubio_level_detection(&vec, threshold));
129129 if (level_detection == NULL) {
130130 PyErr_SetString (PyExc_ValueError, "failed computing level_detection");
131131 return NULL;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t