Changeset 363ce7a for interfaces/python
- Timestamp:
- Dec 25, 2009, 4:45:46 AM (15 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:
- ce4bfe3
- Parents:
- a52d3ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
interfaces/python/py-filterbank.c
ra52d3ae r363ce7a 55 55 PyObject *input; 56 56 Py_cvec *vec; 57 Py_fvec *output;57 fvec_t *out; 58 58 59 59 if (!PyArg_ParseTuple (args, "O", &input)) { … … 67 67 } 68 68 69 output = (Py_fvec*) PyObject_New (Py_fvec, &Py_fvecType); 70 output->length = self->n_filters; 71 output->o = new_fvec(self->n_filters); 69 out = new_fvec (self->n_filters); 72 70 73 71 // compute the function 74 aubio_filterbank_do (self->o, vec->o, out put->o);75 return (PyObject *)PyAubio_ FvecToArray(output);72 aubio_filterbank_do (self->o, vec->o, out); 73 return (PyObject *)PyAubio_CFvecToArray(out); 76 74 } 77 75 … … 90 88 PyObject *input; 91 89 uint_t samplerate; 92 Py_fvec*freqs;90 fvec_t *freqs; 93 91 if (!PyArg_ParseTuple (args, "OI", &input, &samplerate)) { 94 92 return NULL; … … 99 97 } 100 98 101 freqs = PyAubio_ArrayTo Fvec (input);99 freqs = PyAubio_ArrayToCFvec (input); 102 100 103 101 if (freqs == NULL) { … … 106 104 107 105 err = aubio_filterbank_set_triangle_bands (self->o, 108 freqs ->o, samplerate);106 freqs, samplerate); 109 107 if (err > 0) { 110 108 PyErr_SetString (PyExc_ValueError, … … 137 135 Py_filterbank_get_coeffs (Py_filterbank * self, PyObject *unused) 138 136 { 139 Py_fmat *output = (Py_fmat *) PyObject_New (Py_fmat, &Py_fvecType); 140 output->o = aubio_filterbank_get_coeffs (self->o); 141 return (PyObject *)PyAubio_FmatToArray(output); 137 return (PyObject *)PyAubio_CFmatToArray( 138 aubio_filterbank_get_coeffs (self->o) ); 142 139 } 143 140
Note: See TracChangeset
for help on using the changeset viewer.