feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 2a109e4 was
96fe713,
checked in by Paul Brossier <piem@piem.org>, 15 years ago
|
interfaces/python: towards mono
|
-
Property mode set to
100644
|
File size:
1.5 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 | |
---|
[96fe713] | 8 | #define Py_default_vector_length 1024 |
---|
| 9 | #define Py_default_vector_height 1 |
---|
[9b23eb31] | 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 | |
---|
[ae6e15c] | 28 | typedef struct |
---|
| 29 | { |
---|
[9b23eb31] | 30 | PyObject_HEAD |
---|
| 31 | fvec_t * o; |
---|
[ae6e15c] | 32 | uint_t length; |
---|
| 33 | } Py_fvec; |
---|
| 34 | extern PyTypeObject Py_fvecType; |
---|
[615ac7d] | 35 | extern PyObject *PyAubio_FvecToArray (Py_fvec * self); |
---|
[d6f9b3a] | 36 | extern PyObject *PyAubio_CFvecToArray (fvec_t * self); |
---|
[615ac7d] | 37 | extern Py_fvec *PyAubio_ArrayToFvec (PyObject * self); |
---|
[352fd5f] | 38 | |
---|
[615ac7d] | 39 | typedef struct |
---|
| 40 | { |
---|
| 41 | PyObject_HEAD |
---|
[96fe713] | 42 | fmat_t * o; |
---|
| 43 | uint_t length; |
---|
| 44 | uint_t height; |
---|
| 45 | } Py_fmat; |
---|
| 46 | extern PyTypeObject Py_fmatType; |
---|
| 47 | extern PyObject *PyAubio_FmatToArray (Py_fmat * self); |
---|
| 48 | extern PyObject *PyAubio_CFmatToArray (fmat_t * self); |
---|
| 49 | extern Py_fmat *PyAubio_ArrayToFmat (PyObject * self); |
---|
| 50 | |
---|
| 51 | typedef struct |
---|
| 52 | { |
---|
| 53 | PyObject_HEAD |
---|
[615ac7d] | 54 | cvec_t * o; |
---|
| 55 | uint_t length; |
---|
| 56 | uint_t channels; |
---|
| 57 | } Py_cvec; |
---|
[9b23eb31] | 58 | extern PyTypeObject Py_cvecType; |
---|
[615ac7d] | 59 | extern PyObject *PyAubio_CvecToArray (Py_cvec * self); |
---|
| 60 | extern Py_cvec *PyAubio_ArrayToCvec (PyObject * self); |
---|
[9b23eb31] | 61 | |
---|
| 62 | extern PyTypeObject Py_filterType; |
---|
| 63 | |
---|
[615ac7d] | 64 | extern PyTypeObject Py_filterbankType; |
---|
[352fd5f] | 65 | |
---|
[615ac7d] | 66 | extern PyTypeObject Py_fftType; |
---|
| 67 | |
---|
| 68 | extern PyTypeObject Py_pvocType; |
---|
Note: See
TracBrowser
for help on using the repository browser.