Changeset 307fdfc
- Timestamp:
- Apr 29, 2016, 9:49:57 PM (9 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:
- b055b4e
- Parents:
- 1ee5e21
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-phasevoc.c
r1ee5e21 r307fdfc 10 10 uint_t hop_s; 11 11 fvec_t vecin; 12 cvec_t *output;13 12 cvec_t cvecin; 14 fvec_t *routput; 13 PyObject *output; 14 cvec_t c_output; 15 PyObject *routput; 16 fvec_t c_routput; 15 17 } Py_pvoc; 16 18 … … 71 73 } 72 74 73 self->output = new_ cvec(self->win_s);74 self->routput = new_ fvec(self->hop_s);75 self->output = new_py_cvec(self->win_s); 76 self->routput = new_py_fvec(self->hop_s); 75 77 76 78 return 0; … … 81 83 Py_pvoc_del (Py_pvoc *self, PyObject *unused) 82 84 { 85 Py_XDECREF(self->output); 86 Py_XDECREF(self->routput); 83 87 del_aubio_pvoc(self->o); 84 del_cvec(self->output);85 del_fvec(self->routput);86 88 Py_TYPE(self)->tp_free((PyObject *) self); 87 89 } … … 101 103 } 102 104 105 Py_INCREF(self->output); 106 if (!PyAubio_PyCvecToCCvec (self->output, &(self->c_output))) { 107 return NULL; 108 } 103 109 // compute the function 104 aubio_pvoc_do (self->o, &(self->vecin), self->output); 105 // convert cvec to py_cvec 106 return PyAubio_CCvecToPyCvec(self->output); 110 aubio_pvoc_do (self->o, &(self->vecin), &(self->c_output)); 111 return self->output; 107 112 } 108 113 … … 115 120 }; 116 121 117 static PyObject * 122 static PyObject * 118 123 Py_pvoc_rdo(Py_pvoc * self, PyObject * args) 119 124 { … … 127 132 } 128 133 134 Py_INCREF(self->routput); 135 if (!PyAubio_ArrayToCFvec(self->routput, &(self->c_routput)) ) { 136 return NULL; 137 } 129 138 // compute the function 130 aubio_pvoc_rdo (self->o, &(self->cvecin), self->routput);131 return PyAubio_CFvecToArray(self->routput);139 aubio_pvoc_rdo (self->o, &(self->cvecin), &(self->c_routput)); 140 return self->routput; 132 141 } 133 142
Note: See TracChangeset
for help on using the changeset viewer.