Changeset 1458de5 for interfaces/python/aubioproxy.c
- Timestamp:
- Jul 11, 2012, 3:41:33 AM (12 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:
- 988f580
- Parents:
- c71e405
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
interfaces/python/aubioproxy.c
rc71e405 r1458de5 13 13 14 14 // we got an array, convert it to an fvec 15 if (PyArray_NDIM ( input) == 0) {15 if (PyArray_NDIM ((PyArrayObject *)input) == 0) { 16 16 PyErr_SetString (PyExc_ValueError, "input array is a scalar"); 17 17 goto fail; 18 } else if (PyArray_NDIM ( input) > 1) {18 } else if (PyArray_NDIM ((PyArrayObject *)input) > 1) { 19 19 PyErr_SetString (PyExc_ValueError, 20 20 "input array has more than one dimensions"); … … 22 22 } 23 23 24 if (!PyArray_ISFLOAT ( input)) {24 if (!PyArray_ISFLOAT ((PyArrayObject *)input)) { 25 25 PyErr_SetString (PyExc_ValueError, "input array should be float"); 26 26 goto fail; 27 } else if (PyArray_TYPE ( input) != AUBIO_NPY_SMPL) {27 } else if (PyArray_TYPE ((PyArrayObject *)input) != AUBIO_NPY_SMPL) { 28 28 PyErr_SetString (PyExc_ValueError, "input array should be float32"); 29 29 goto fail; … … 36 36 // no need to really allocate fvec, just its struct member 37 37 vec = (fvec_t *)malloc(sizeof(fvec_t)); 38 vec->length = PyArray_SIZE ( array);39 vec->data = (smpl_t *) PyArray_GETPTR1 ( array, 0);38 vec->length = PyArray_SIZE ((PyArrayObject *)array); 39 vec->data = (smpl_t *) PyArray_GETPTR1 ((PyArrayObject *)array, 0); 40 40 41 41 } else if (PyObject_TypeCheck (input, &PyList_Type)) {
Note: See TracChangeset
for help on using the changeset viewer.