Changeset 352fd5f for interfaces
- Timestamp:
- Oct 2, 2009, 11:19:48 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:
- 6b1aafc
- Parents:
- eb7f743
- Location:
- interfaces/python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
interfaces/python/aubio-types.h
reb7f743 r352fd5f 4 4 #include <numpy/arrayobject.h> 5 5 #include <aubio.h> 6 7 #define Py_fvec_default_length 1024 8 #define Py_fvec_default_channels 1 9 10 #ifdef HAVE_AUBIO_DOUBLE 11 #define AUBIO_FLOAT NPY_FLOAT 12 #else 13 #define AUBIO_FLOAT NPY_LONG 14 #endif 15 16 /** 17 18 Defining this constant to 1 will allow PyAubio_CastToFvec to convert from data 19 types different than NPY_FLOAT to and fvec, and therefore creating a copy of 20 it. 21 22 */ 23 #define AUBIO_DO_CASTING 0 6 24 7 25 typedef struct … … 12 30 } Py_fvec; 13 31 extern PyTypeObject Py_fvecType; 32 33 extern PyObject *PyAubio_FvecToArray (Py_fvec * self); 34 35 extern Py_fvec *PyAubio_ArrayToFvec (PyObject * self); -
interfaces/python/py-fvec.c
reb7f743 r352fd5f 11 11 */ 12 12 13 #define Py_fvec_default_length 102414 #define Py_fvec_default_channels 115 16 13 static char Py_fvec_doc[] = "fvec object"; 17 14 … … 109 106 } 110 107 111 staticPyObject *112 Py _fvec_array (Py_fvec * self)108 PyObject * 109 PyAubio_FvecToArray (Py_fvec * self) 113 110 { 114 111 PyObject *array = NULL; … … 199 196 {"dump", (PyCFunction) Py_fvec_print, METH_NOARGS, 200 197 "Dumps the contents of the vector to stdout."}, 201 {"__array__", (PyCFunction) Py _fvec_array, METH_NOARGS,198 {"__array__", (PyCFunction) PyAubio_FvecToArray, METH_NOARGS, 202 199 "Returns the first channel as a numpy array."}, 203 200 {NULL} … … 221 218 PyObject_HEAD_INIT (NULL) 222 219 0, /* ob_size */ 223 " fvec",/* tp_name */220 "aubio.fvec", /* tp_name */ 224 221 sizeof (Py_fvec), /* tp_basicsize */ 225 222 0, /* tp_itemsize */
Note: See TracChangeset
for help on using the changeset viewer.