2 #include <structmember.h>
4 #include "aubio-docstrings.h"
5 #include "aubio-generated.h"
7 #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
9 // define numpy unique symbols for aubio
10 #define PY_ARRAY_UNIQUE_SYMBOL PYAUBIO_ARRAY_API
11 #define PY_UFUNC_UNIQUE_SYMBOL PYAUBIO_UFUNC_API
13 // only import array and ufunc from main module
14 #ifndef PY_AUBIO_MODULE_MAIN
15 #define NO_IMPORT_ARRAY
17 #include <numpy/arrayobject.h>
18 #ifndef PY_AUBIO_MODULE_UFUNC
19 #define NO_IMPORT_UFUNC
21 #include <numpy/ufuncobject.h>
24 //#include <numpy/npy_3kcompat.h>
27 #define AUBIO_UNSTABLE 1
28 #ifdef USE_LOCAL_AUBIO
31 #include <aubio/aubio.h>
34 #define Py_default_vector_length 1024
36 #define Py_aubio_default_samplerate 44100
39 // 64 bit precision with HAVE_AUBIO_DOUBLE=1
40 #define AUBIO_NPY_SMPL NPY_DOUBLE
41 #define AUBIO_NPY_SMPL_STR "float64"
42 #define AUBIO_NPY_SMPL_CHR "d"
44 // default is 32 bit precision
45 #define AUBIO_NPY_SMPL NPY_FLOAT
46 #define AUBIO_NPY_SMPL_STR "float32"
47 #define AUBIO_NPY_SMPL_CHR "f"
52 #define PATH_MAX MAX_PATH
58 // compat with Python < 2.6
60 #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
63 extern PyTypeObject Py_cvecType;
65 PyObject * new_py_fvec(uint_t length);
66 PyObject * new_py_cvec(uint_t length);
67 PyObject * new_py_fmat(uint_t height, uint_t length);
69 // defined in aubio-proxy.c
70 extern int PyAubio_IsValidVector (PyObject *input);
72 extern PyObject *PyAubio_CFvecToArray (fvec_t * self);
73 extern int PyAubio_ArrayToCFvec (PyObject * self, fvec_t *out);
75 extern int PyAubio_PyCvecToCCvec (PyObject *input, cvec_t *i);
77 extern PyObject *PyAubio_CFmatToArray (fmat_t * self);
78 extern int PyAubio_ArrayToCFmat (PyObject *input, fmat_t *out);
80 // hand written wrappers
81 extern PyTypeObject Py_filterType;
83 extern PyTypeObject Py_filterbankType;
85 extern PyTypeObject Py_fftType;
87 extern PyTypeObject Py_pvocType;
89 extern PyTypeObject Py_sourceType;
91 extern PyTypeObject Py_sinkType;