source: interfaces/python/aubio-types.h @ 0f045b2

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 0f045b2 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
Line 
1#include <Python.h>
2#include <structmember.h>
3#define NO_IMPORT_ARRAY
4#include <numpy/arrayobject.h>
5#define AUBIO_UNSTABLE 1
6#include <aubio.h>
7
8#define Py_default_vector_length 1024
9#define Py_default_vector_height 1
10
11#define Py_aubio_default_samplerate 44100
12
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
16#else
17#define AUBIO_NPY_SMPL NPY_FLOAT
18#endif
19
20/**
21
22Defining this constant to 1 will allow PyAubio_CastToFvec to convert from data
23types different than NPY_FLOAT to and fvec, and therefore creating a copy of
24it.
25
26*/
27
28typedef struct
29{
30  PyObject_HEAD
31  fvec_t * o;
32  uint_t length;
33} Py_fvec;
34extern PyTypeObject Py_fvecType;
35extern PyObject *PyAubio_FvecToArray (Py_fvec * self);
36extern PyObject *PyAubio_CFvecToArray (fvec_t * self);
37extern Py_fvec *PyAubio_ArrayToFvec (PyObject * self);
38
39typedef struct
40{
41  PyObject_HEAD
42  fmat_t * o;
43  uint_t length;
44  uint_t height;
45} Py_fmat;
46extern PyTypeObject Py_fmatType;
47extern PyObject *PyAubio_FmatToArray (Py_fmat * self);
48extern PyObject *PyAubio_CFmatToArray (fmat_t * self);
49extern Py_fmat *PyAubio_ArrayToFmat (PyObject * self);
50
51typedef struct
52{
53  PyObject_HEAD
54  cvec_t * o;
55  uint_t length;
56  uint_t channels;
57} Py_cvec;
58extern PyTypeObject Py_cvecType;
59extern PyObject *PyAubio_CvecToArray (Py_cvec * self);
60extern Py_cvec *PyAubio_ArrayToCvec (PyObject * self);
61
62extern PyTypeObject Py_filterType;
63
64extern PyTypeObject Py_filterbankType;
65
66extern PyTypeObject Py_fftType;
67
68extern PyTypeObject Py_pvocType;
Note: See TracBrowser for help on using the repository browser.