feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since eb089fb was
9b23eb31,
checked in by Paul Brossier <piem@piem.org>, 15 years ago
|
interfaces/python: add cvec and filter types
|
-
Property mode set to
100644
|
File size:
847 bytes
|
Line | |
---|
1 | #include <Python.h> |
---|
2 | #include <structmember.h> |
---|
3 | #define NO_IMPORT_ARRAY |
---|
4 | #include <numpy/arrayobject.h> |
---|
5 | #include <aubio.h> |
---|
6 | |
---|
7 | #define Py_default_vector_length 1024 |
---|
8 | #define Py_default_vector_channels 1 |
---|
9 | |
---|
10 | #define Py_aubio_default_samplerate 44100 |
---|
11 | |
---|
12 | #ifdef HAVE_AUBIO_DOUBLE |
---|
13 | #define AUBIO_FLOAT NPY_FLOAT |
---|
14 | #else |
---|
15 | #define AUBIO_FLOAT NPY_LONG |
---|
16 | #endif |
---|
17 | |
---|
18 | /** |
---|
19 | |
---|
20 | Defining this constant to 1 will allow PyAubio_CastToFvec to convert from data |
---|
21 | types different than NPY_FLOAT to and fvec, and therefore creating a copy of |
---|
22 | it. |
---|
23 | |
---|
24 | */ |
---|
25 | #define AUBIO_DO_CASTING 0 |
---|
26 | |
---|
27 | typedef struct |
---|
28 | { |
---|
29 | PyObject_HEAD |
---|
30 | fvec_t * o; |
---|
31 | uint_t length; |
---|
32 | uint_t channels; |
---|
33 | } Py_fvec; |
---|
34 | extern PyTypeObject Py_fvecType; |
---|
35 | |
---|
36 | extern PyTypeObject Py_cvecType; |
---|
37 | |
---|
38 | extern PyTypeObject Py_filterType; |
---|
39 | |
---|
40 | extern PyObject *PyAubio_FvecToArray (Py_fvec * self); |
---|
41 | |
---|
42 | extern Py_fvec *PyAubio_ArrayToFvec (PyObject * self); |
---|
Note: See
TracBrowser
for help on using the repository browser.