Changeset c04d250


Ignore:
Timestamp:
Dec 25, 2009, 4:44:06 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:
a52d3ae
Parents:
965b302
Message:

py-phasevoc.c: use new proxy functions

File:
1 edited

Legend:

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

    r965b302 rc04d250  
    5656
    5757static PyObject *
    58 Py_pvoc_do(PyObject * self, PyObject * args)
     58Py_pvoc_do(Py_pvoc * self, PyObject * args)
    5959{
    6060  PyObject *input;
    61   Py_fvec *vec;
    62   Py_cvec *output;
     61  fvec_t *vec;
     62  cvec_t *output;
    6363
    6464  if (!PyArg_ParseTuple (args, "O", &input)) {
     
    6666  }
    6767
    68   vec = PyAubio_ArrayToFvec (input);
     68  vec = PyAubio_ArrayToCFvec (input);
    6969
    7070  if (vec == NULL) {
     
    7272  }
    7373
    74   output = (Py_cvec*) PyObject_New (Py_cvec, &Py_cvecType);
    75   output->length = ((Py_pvoc *) self)->win_s;
    76   output->o = new_cvec(((Py_pvoc *) self)->win_s);
     74  output = new_cvec(self->win_s);
    7775
    7876  // compute the function
    79   aubio_pvoc_do (((Py_pvoc *)self)->o, vec->o, output->o);
    80   Py_INCREF(output);
    81   return (PyObject *)output;
    82   //return (PyObject *)PyAubio_CvecToArray(output);
     77  aubio_pvoc_do (self->o, vec, output);
     78  return (PyObject *)PyAubio_CCvecToPyCvec(output);
    8379}
    8480
     
    9187
    9288static PyObject *
    93 Py_pvoc_rdo(PyObject * self, PyObject * args)
     89Py_pvoc_rdo(Py_pvoc * self, PyObject * args)
    9490{
    9591  PyObject *input;
    96   Py_cvec *vec;
    97   Py_fvec *output;
     92  cvec_t *vec;
     93  fvec_t *output;
    9894
    9995  if (!PyArg_ParseTuple (args, "O", &input)) {
     
    10197  }
    10298
    103   vec = PyAubio_ArrayToCvec (input);
     99  vec = PyAubio_ArrayToCCvec (input);
    104100
    105101  if (vec == NULL) {
     
    107103  }
    108104
    109   output = (Py_fvec*) PyObject_New (Py_fvec, &Py_fvecType);
    110   output->length = ((Py_pvoc *) self)->hop_s;
    111   output->o = new_fvec(output->length);
     105  output = new_fvec(self->hop_s);
    112106
    113107  // compute the function
    114   aubio_pvoc_rdo (((Py_pvoc *)self)->o, vec->o, output->o);
    115   return (PyObject *)PyAubio_FvecToArray(output);
     108  aubio_pvoc_rdo (self->o, vec, output);
     109  return (PyObject *)PyAubio_CFvecToArray(output);
    116110}
    117111
Note: See TracChangeset for help on using the changeset viewer.