{
PyObject *input;
Py_cvec *vec;
- Py_fvec *output;
+ fvec_t *out;
if (!PyArg_ParseTuple (args, "O", &input)) {
return NULL;
return NULL;
}
- output = (Py_fvec*) PyObject_New (Py_fvec, &Py_fvecType);
- output->length = self->n_filters;
- output->o = new_fvec(self->n_filters);
+ out = new_fvec (self->n_filters);
// compute the function
- aubio_filterbank_do (self->o, vec->o, output->o);
- return (PyObject *)PyAubio_FvecToArray(output);
+ aubio_filterbank_do (self->o, vec->o, out);
+ return (PyObject *)PyAubio_CFvecToArray(out);
}
AUBIO_MEMBERS_START(filterbank)
PyObject *input;
uint_t samplerate;
- Py_fvec *freqs;
+ fvec_t *freqs;
if (!PyArg_ParseTuple (args, "OI", &input, &samplerate)) {
return NULL;
}
return NULL;
}
- freqs = PyAubio_ArrayToFvec (input);
+ freqs = PyAubio_ArrayToCFvec (input);
if (freqs == NULL) {
return NULL;
}
err = aubio_filterbank_set_triangle_bands (self->o,
- freqs->o, samplerate);
+ freqs, samplerate);
if (err > 0) {
PyErr_SetString (PyExc_ValueError,
"error when setting filter to A-weighting");
static PyObject *
Py_filterbank_get_coeffs (Py_filterbank * self, PyObject *unused)
{
- Py_fmat *output = (Py_fmat *) PyObject_New (Py_fmat, &Py_fvecType);
- output->o = aubio_filterbank_get_coeffs (self->o);
- return (PyObject *)PyAubio_FmatToArray(output);
+ return (PyObject *)PyAubio_CFmatToArray(
+ aubio_filterbank_get_coeffs (self->o) );
}
static PyMethodDef Py_filterbank_methods[] = {