Changeset a28dab6
- Timestamp:
- Apr 18, 2016, 1:18:01 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:
- 59cb451
- Parents:
- f2caa92
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-source.c
rf2caa92 ra28dab6 9 9 uint_t channels; 10 10 uint_t hop_size; 11 fvec_t *read_to; 12 fmat_t *mread_to; 11 13 } Py_source; 12 14 … … 146 148 } 147 149 150 self->read_to = new_fvec(self->hop_size); 151 self->mread_to = new_fmat (self->channels, self->hop_size); 152 148 153 return 0; 149 154 } 150 155 151 AUBIO_DEL(source) 156 static void 157 Py_source_del (Py_source *self, PyObject *unused) 158 { 159 del_aubio_source(self->o); 160 del_fvec(self->read_to); 161 del_fmat(self->mread_to); 162 self->ob_type->tp_free((PyObject *) self); 163 } 164 152 165 153 166 /* function Py_source_do */ … … 158 171 159 172 /* output vectors prototypes */ 160 fvec_t* read_to;161 173 uint_t read; 162 174 … … 167 179 168 180 /* creating output read_to as a new_fvec of length self->hop_size */ 169 read_to = new_fvec (self->hop_size);170 181 read = 0; 171 182 172 183 173 184 /* compute _do function */ 174 aubio_source_do (self->o, read_to, &read);185 aubio_source_do (self->o, self->read_to, &read); 175 186 176 187 PyObject *outputs = PyList_New(0); 177 PyList_Append( outputs, (PyObject *)PyAubio_CFvecToArray (read_to)); 178 //del_fvec (read_to); 188 PyList_Append( outputs, (PyObject *)PyAubio_CFvecToArray (self->read_to)); 179 189 PyList_Append( outputs, (PyObject *)PyInt_FromLong (read)); 180 190 return outputs; … … 188 198 189 199 /* output vectors prototypes */ 190 fmat_t* read_to;191 200 uint_t read; 192 201 … … 196 205 197 206 198 /* creating output read_to as a new_fvec of length self->hop_size */ 199 read_to = new_fmat (self->channels, self->hop_size); 207 /* creating output mread_to as a new_fvec of length self->hop_size */ 200 208 read = 0; 201 209 202 210 203 211 /* compute _do function */ 204 aubio_source_do_multi (self->o, read_to, &read);212 aubio_source_do_multi (self->o, self->mread_to, &read); 205 213 206 214 PyObject *outputs = PyList_New(0); 207 PyList_Append( outputs, (PyObject *)PyAubio_CFmatToArray (read_to)); 208 //del_fvec (read_to); 215 PyList_Append( outputs, (PyObject *)PyAubio_CFmatToArray (self->mread_to)); 209 216 PyList_Append( outputs, (PyObject *)PyInt_FromLong (read)); 210 217 return outputs;
Note: See TracChangeset
for help on using the changeset viewer.