Changeset 0f045b2
- Timestamp:
- Dec 5, 2009, 1:45:08 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:
- b7f3aaf
- Parents:
- 96fe713
- Location:
- interfaces/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
interfaces/python/py-phasevoc.c
r96fe713 r0f045b2 3 3 static char Py_pvoc_doc[] = "pvoc object"; 4 4 5 AUBIO_DECLARE(pvoc, uint_t win_s; uint_t hop_s ; uint_t channels)5 AUBIO_DECLARE(pvoc, uint_t win_s; uint_t hop_s) 6 6 7 7 //AUBIO_NEW(pvoc) … … 9 9 Py_pvoc_new (PyTypeObject * type, PyObject * args, PyObject * kwds) 10 10 { 11 int win_s = 0, hop_s = 0 , channels = 0;11 int win_s = 0, hop_s = 0; 12 12 Py_pvoc *self; 13 static char *kwlist[] = { "win_s", "hop_s", "channels",NULL };13 static char *kwlist[] = { "win_s", "hop_s", NULL }; 14 14 15 if (!PyArg_ParseTupleAndKeywords (args, kwds, "|II I", kwlist,16 &win_s, &hop_s , &channels)) {15 if (!PyArg_ParseTupleAndKeywords (args, kwds, "|II", kwlist, 16 &win_s, &hop_s)) { 17 17 return NULL; 18 18 } … … 26 26 self->win_s = Py_default_vector_length; 27 27 self->hop_s = Py_default_vector_length/2; 28 self->channels = Py_default_vector_channels;29 28 30 29 if (self == NULL) { … … 48 47 } 49 48 50 if (channels > 0) {51 self->channels = channels;52 } else if (channels < 0) {53 PyErr_SetString (PyExc_ValueError,54 "can not use negative number of filters");55 return NULL;56 }57 58 49 return (PyObject *) self; 59 50 } 60 51 61 52 62 AUBIO_INIT(pvoc, self->win_s, self->hop_s , self->channels)53 AUBIO_INIT(pvoc, self->win_s, self->hop_s) 63 54 64 55 AUBIO_DEL(pvoc) … … 82 73 83 74 output = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType); 84 output->channels = vec->channels;85 75 output->length = ((Py_pvoc *) self)->win_s; 86 output->o = new_cvec(((Py_pvoc *) self)->win_s , vec->channels);76 output->o = new_cvec(((Py_pvoc *) self)->win_s); 87 77 88 78 // compute the function … … 98 88 {"hop_s", T_INT, offsetof (Py_pvoc, hop_s), READONLY, 99 89 "size of the hop"}, 100 {"channels", T_INT, offsetof (Py_pvoc, channels), READONLY,101 "number of channels"},102 90 AUBIO_MEMBERS_STOP(pvoc) 103 91 … … 120 108 121 109 output = (Py_fvec*) PyObject_New (Py_fvec, &Py_fvecType); 122 output->channels = vec->channels;123 110 output->length = ((Py_pvoc *) self)->hop_s; 124 output->o = new_fvec(output->length , output->channels);111 output->o = new_fvec(output->length); 125 112 126 113 // compute the function -
interfaces/python/setup.py
r96fe713 r0f045b2 11 11 ["aubiomodule.c", 12 12 "py-fvec.c", 13 "py-fmat.c", 13 14 "py-cvec.c", 14 15 "py-filter.c",
Note: See TracChangeset
for help on using the changeset viewer.