Changeset f6cbefe for interfaces/python/py-filterbank.c
- Timestamp:
- Jul 12, 2012, 1:38:40 AM (12 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, pitchshift, sampler, timestretch, yinfft+
- Children:
- 5e3ed60
- Parents:
- 93004d5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
interfaces/python/py-filterbank.c
r93004d5 rf6cbefe 50 50 AUBIO_DEL(filterbank) 51 51 52 static PyObject * 52 static PyObject * 53 53 Py_filterbank_do(Py_filterbank * self, PyObject * args) 54 54 { … … 74 74 } 75 75 76 AUBIO_MEMBERS_START(filterbank) 76 AUBIO_MEMBERS_START(filterbank) 77 77 {"win_s", T_INT, offsetof (Py_filterbank, win_s), READONLY, 78 78 "size of the window"}, … … 81 81 AUBIO_MEMBERS_STOP(filterbank) 82 82 83 static PyObject * 83 static PyObject * 84 84 Py_filterbank_set_triangle_bands (Py_filterbank * self, PyObject *args) 85 85 { … … 113 113 } 114 114 115 static PyObject * 115 static PyObject * 116 116 Py_filterbank_set_mel_coeffs_slaney (Py_filterbank * self, PyObject *args) 117 117 { … … 132 132 } 133 133 134 static PyObject * 134 static PyObject * 135 Py_filterbank_set_coeffs (Py_filterbank * self, PyObject *args) 136 { 137 uint_t err = 0; 138 139 PyObject *input; 140 fmat_t *coeffs; 141 142 if (!PyArg_ParseTuple (args, "O", &input)) { 143 return NULL; 144 } 145 146 coeffs = PyAubio_ArrayToCFmat (input); 147 148 if (coeffs == NULL) { 149 PyErr_SetString (PyExc_ValueError, 150 "unable to parse input array"); 151 return NULL; 152 } 153 154 err = aubio_filterbank_set_coeffs (self->o, coeffs); 155 156 if (err > 0) { 157 PyErr_SetString (PyExc_ValueError, 158 "error when setting filter coefficients"); 159 return NULL; 160 } 161 return Py_None; 162 } 163 164 static PyObject * 135 165 Py_filterbank_get_coeffs (Py_filterbank * self, PyObject *unused) 136 166 { … … 146 176 {"get_coeffs", (PyCFunction) Py_filterbank_get_coeffs, 147 177 METH_NOARGS, "get coefficients of filterbank"}, 178 {"set_coeffs", (PyCFunction) Py_filterbank_set_coeffs, 179 METH_VARARGS, "set coefficients of filterbank"}, 148 180 {NULL} 149 181 };
Note: See TracChangeset
for help on using the changeset viewer.