From 965adee4bf9ec7b241b59b53e0e26cd2b02d0cb6 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 6 Sep 2017 14:01:51 +0200 Subject: [PATCH] python/ext/py-phasevoc.c: add _set_window --- python/ext/py-phasevoc.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/python/ext/py-phasevoc.c b/python/ext/py-phasevoc.c index 74ddc180..e53fdf93 100644 --- a/python/ext/py-phasevoc.c +++ b/python/ext/py-phasevoc.c @@ -155,9 +155,28 @@ Py_pvoc_rdo(Py_pvoc * self, PyObject * args) return self->routput; } +static PyObject * +Pyaubio_pvoc_set_window (Py_pvoc *self, PyObject *args) +{ + uint_t err = 0; + char_t *window = NULL; + + if (!PyArg_ParseTuple (args, "s", &window)) { + return NULL; + } + err = aubio_pvoc_set_window (self->o, window); + + if (err > 0) { + PyErr_SetString (PyExc_ValueError, "error running aubio_pvoc_set_window"); + return NULL; + } + Py_RETURN_NONE; +} + static PyMethodDef Py_pvoc_methods[] = { {"rdo", (PyCFunction) Py_pvoc_rdo, METH_VARARGS, "synthesis of spectral grain"}, + {"set_window", (PyCFunction) Pyaubio_pvoc_set_window, METH_VARARGS, ""}, {NULL} }; -- 2.11.0