Changeset c04d250 for interfaces
- Timestamp:
- Dec 25, 2009, 4:44:06 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:
- a52d3ae
- Parents:
- 965b302
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
interfaces/python/py-phasevoc.c
r965b302 rc04d250 56 56 57 57 static PyObject * 58 Py_pvoc_do(Py Object* self, PyObject * args)58 Py_pvoc_do(Py_pvoc * self, PyObject * args) 59 59 { 60 60 PyObject *input; 61 Py_fvec*vec;62 Py_cvec*output;61 fvec_t *vec; 62 cvec_t *output; 63 63 64 64 if (!PyArg_ParseTuple (args, "O", &input)) { … … 66 66 } 67 67 68 vec = PyAubio_ArrayTo Fvec (input);68 vec = PyAubio_ArrayToCFvec (input); 69 69 70 70 if (vec == NULL) { … … 72 72 } 73 73 74 output = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType); 75 output->length = ((Py_pvoc *) self)->win_s; 76 output->o = new_cvec(((Py_pvoc *) self)->win_s); 74 output = new_cvec(self->win_s); 77 75 78 76 // compute the function 79 aubio_pvoc_do (((Py_pvoc *)self)->o, vec->o, output->o); 80 Py_INCREF(output); 81 return (PyObject *)output; 82 //return (PyObject *)PyAubio_CvecToArray(output); 77 aubio_pvoc_do (self->o, vec, output); 78 return (PyObject *)PyAubio_CCvecToPyCvec(output); 83 79 } 84 80 … … 91 87 92 88 static PyObject * 93 Py_pvoc_rdo(Py Object* self, PyObject * args)89 Py_pvoc_rdo(Py_pvoc * self, PyObject * args) 94 90 { 95 91 PyObject *input; 96 Py_cvec*vec;97 Py_fvec*output;92 cvec_t *vec; 93 fvec_t *output; 98 94 99 95 if (!PyArg_ParseTuple (args, "O", &input)) { … … 101 97 } 102 98 103 vec = PyAubio_ArrayToC vec (input);99 vec = PyAubio_ArrayToCCvec (input); 104 100 105 101 if (vec == NULL) { … … 107 103 } 108 104 109 output = (Py_fvec*) PyObject_New (Py_fvec, &Py_fvecType); 110 output->length = ((Py_pvoc *) self)->hop_s; 111 output->o = new_fvec(output->length); 105 output = new_fvec(self->hop_s); 112 106 113 107 // compute the function 114 aubio_pvoc_rdo ( ((Py_pvoc *)self)->o, vec->o, output->o);115 return (PyObject *)PyAubio_ FvecToArray(output);108 aubio_pvoc_rdo (self->o, vec, output); 109 return (PyObject *)PyAubio_CFvecToArray(output); 116 110 } 117 111
Note: See TracChangeset
for help on using the changeset viewer.