source:
interfaces/python/aubio-types.h
@
aea235c
Last change on this file since aea235c was d6f9b3a, checked in by , 15 years ago | |
---|---|
|
|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[ae6e15c] | 1 | #include <Python.h> |
2 | #include <structmember.h> | |
3 | #define NO_IMPORT_ARRAY | |
4 | #include <numpy/arrayobject.h> | |
[7db3477] | 5 | #define AUBIO_UNSTABLE 1 |
[ae6e15c] | 6 | #include <aubio.h> |
7 | ||
[9b23eb31] | 8 | #define Py_default_vector_length 1024 |
9 | #define Py_default_vector_channels 1 | |
10 | ||
11 | #define Py_aubio_default_samplerate 44100 | |
[352fd5f] | 12 | |
[615ac7d] | 13 | #if HAVE_AUBIO_DOUBLE |
14 | #error "Ouch! Python interface for aubio has not been much tested yet." | |
15 | #define AUBIO_NPY_SMPL NPY_DOUBLE | |
[352fd5f] | 16 | #else |
[615ac7d] | 17 | #define AUBIO_NPY_SMPL NPY_FLOAT |
[352fd5f] | 18 | #endif |
19 | ||
20 | /** | |
21 | ||
22 | Defining this constant to 1 will allow PyAubio_CastToFvec to convert from data | |
23 | types different than NPY_FLOAT to and fvec, and therefore creating a copy of | |
24 | it. | |
25 | ||
26 | */ | |
27 | #define AUBIO_DO_CASTING 0 | |
28 | ||
[ae6e15c] | 29 | typedef struct |
30 | { | |
[9b23eb31] | 31 | PyObject_HEAD |
32 | fvec_t * o; | |
[ae6e15c] | 33 | uint_t length; |
34 | uint_t channels; | |
35 | } Py_fvec; | |
36 | extern PyTypeObject Py_fvecType; | |
[615ac7d] | 37 | extern PyObject *PyAubio_FvecToArray (Py_fvec * self); |
[d6f9b3a] | 38 | extern PyObject *PyAubio_CFvecToArray (fvec_t * self); |
[615ac7d] | 39 | extern Py_fvec *PyAubio_ArrayToFvec (PyObject * self); |
[352fd5f] | 40 | |
[615ac7d] | 41 | typedef struct |
42 | { | |
43 | PyObject_HEAD | |
44 | cvec_t * o; | |
45 | uint_t length; | |
46 | uint_t channels; | |
47 | } Py_cvec; | |
[9b23eb31] | 48 | extern PyTypeObject Py_cvecType; |
[615ac7d] | 49 | extern PyObject *PyAubio_CvecToArray (Py_cvec * self); |
50 | extern Py_cvec *PyAubio_ArrayToCvec (PyObject * self); | |
[9b23eb31] | 51 | |
52 | extern PyTypeObject Py_filterType; | |
53 | ||
[615ac7d] | 54 | extern PyTypeObject Py_filterbankType; |
[352fd5f] | 55 | |
[615ac7d] | 56 | extern PyTypeObject Py_fftType; |
57 | ||
58 | extern PyTypeObject Py_pvocType; |
Note: See TracBrowser
for help on using the repository browser.