Changeset a52d3ae


Ignore:
Timestamp:
Dec 25, 2009, 4:45:18 AM (14 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
363ce7a
Parents:
c04d250
Message:

py-filter.c: use new proxy function, switch to mono

File:
1 edited

Legend:

Unmodified
Added
Removed
  • interfaces/python/py-filter.c

    rc04d250 ra52d3ae  
    1717  static char *kwlist[] = { "order", NULL };
    1818
    19   if (!PyArg_ParseTupleAndKeywords (args, kwds, "|II", kwlist,
     19  if (!PyArg_ParseTupleAndKeywords (args, kwds, "|I", kwlist,
    2020          &order)) {
    2121    return NULL;
     
    6060
    6161static PyObject *
    62 Py_filter_do(PyObject * self, PyObject * args)
     62Py_filter_do(Py_filter * self, PyObject * args)
    6363{
    6464  PyObject *input;
    65   Py_fvec *vec;
     65  fvec_t *vec;
    6666
    6767  if (!PyArg_ParseTuple (args, "O:digital_filter.do", &input)) {
     
    7373  }
    7474
    75   vec = PyAubio_ArrayToFvec (input);
     75  vec = PyAubio_ArrayToCFvec (input);
    7676
    7777  if (vec == NULL) {
     
    8080
    8181  // compute the function
    82 #if 1
    83   aubio_filter_do (((Py_filter *)self)->o, vec->o);
    84   PyArray_INCREF((PyArrayObject*)vec);
    85   return (PyObject *)vec;
    86 #else
    87   Py_fvec *copy = (Py_fvec*) PyObject_New (Py_fvec, &Py_fvecType);
    88   copy->o = new_fvec(vec->o->length);
    89   aubio_filter_do_outplace (((Py_filter *)self)->o, vec->o, copy->o);
    90   return (PyObject *)copy;
    91 #endif
     82  fvec_t * out = new_fvec(vec->length);
     83  aubio_filter_do_outplace (self->o, vec, out);
     84  return PyAubio_CFvecToArray(out);
    9285}
    9386
Note: See TracChangeset for help on using the changeset viewer.