Changeset 78706cd
- Timestamp:
- Nov 17, 2018, 12:23:45 PM (6 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master
- Children:
- 16f0c27
- Parents:
- 831f702
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-filterbank.c
r831f702 r78706cd 264 264 return (PyObject *)PyAubio_CFmatToArray( 265 265 aubio_filterbank_get_coeffs (self->o) ); 266 } 267 268 static PyObject * 269 Py_filterbank_set_power(Py_filterbank *self, PyObject *args) 270 { 271 uint_t playing; 272 273 if (!PyArg_ParseTuple (args, "I", &playing)) { 274 return NULL; 275 } 276 if(aubio_filterbank_set_power (self->o, playing)) { 277 if (PyErr_Occurred() == NULL) { 278 PyErr_SetString (PyExc_ValueError, 279 "error running filterbank.set_power"); 280 } else { 281 // change the RuntimeError into ValueError 282 PyObject *type, *value, *traceback; 283 PyErr_Fetch(&type, &value, &traceback); 284 PyErr_Restore(PyExc_ValueError, value, traceback); 285 } 286 return NULL; 287 } 288 Py_RETURN_NONE; 289 } 290 291 static PyObject * 292 Py_filterbank_set_norm(Py_filterbank *self, PyObject *args) 293 { 294 uint_t playing; 295 296 if (!PyArg_ParseTuple (args, "I", &playing)) { 297 return NULL; 298 } 299 if(aubio_filterbank_set_norm (self->o, playing)) { 300 if (PyErr_Occurred() == NULL) { 301 PyErr_SetString (PyExc_ValueError, 302 "error running filterbank.set_power"); 303 } else { 304 // change the RuntimeError into ValueError 305 PyObject *type, *value, *traceback; 306 PyErr_Fetch(&type, &value, &traceback); 307 PyErr_Restore(PyExc_ValueError, value, traceback); 308 } 309 return NULL; 310 } 311 Py_RETURN_NONE; 266 312 } 267 313 … … 279 325 {"set_coeffs", (PyCFunction) Py_filterbank_set_coeffs, 280 326 METH_VARARGS, "set coefficients of filterbank"}, 327 {"set_power", (PyCFunction) Py_filterbank_set_power, 328 METH_VARARGS, "set power applied to filterbank input spectrum"}, 329 {"set_norm", (PyCFunction) Py_filterbank_set_norm, 330 METH_VARARGS, "set norm applied to filterbank input spectrum"}, 281 331 {NULL} 282 332 };
Note: See TracChangeset
for help on using the changeset viewer.