From 8adfb3bd99b4dcff2459756af090a640fd7a4b4a Mon Sep 17 00:00:00 2001 From: yo mama Date: Fri, 19 Jun 2015 16:24:27 -0400 Subject: clone --- pysoundtouch/src/pybpmdetect.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 pysoundtouch/src/pybpmdetect.h (limited to 'pysoundtouch/src/pybpmdetect.h') diff --git a/pysoundtouch/src/pybpmdetect.h b/pysoundtouch/src/pybpmdetect.h new file mode 100644 index 0000000..54438d0 --- /dev/null +++ b/pysoundtouch/src/pybpmdetect.h @@ -0,0 +1,41 @@ +/* + * python interface to soundtouch (the open-source audio processing library) + * BPM Detection + */ + +#ifndef __PY_BMPDETECT_H__ +#define __PY_BMPDETECT_H__ + +#include +#include + +#define BUFFER_SIZE 44100 + +// Definition of the bpmdetect object +typedef struct { + PyObject_HEAD + soundtouch::BPMDetect* bpmdetect; + int channels; // 1 or 2 + union { + char chars[BUFFER_SIZE]; + short shorts[BUFFER_SIZE/2]; + } buffer; +} py_bpmdetect; /* Soundtouch */ + +#define PY_BPMDETECT(x) ((py_bpmdetect *) x) + +extern PyTypeObject py_bpmdetect_t; + +// Deallocate the BPMDetect object +static void py_bpmdetect_dealloc(PyObject* self, PyObject* args); + +// Read in a number of samples for beat detection +static PyObject* py_bpmdetect_put_samples(PyObject* self, PyObject* args); + +// Perform the beat detection algorithm +static PyObject* py_bpmdetect_get_bpm(PyObject* self, PyObject* args); + +// Extract information from the bpmdetect object +static PyObject* py_bpmdetect_getattr(PyObject* self, char* name); + +#endif -- cgit v1.2.3-70-g09d2