Changeset efa62ce for python/ext


Ignore:
Timestamp:
Jul 10, 2015, 12:59:23 AM (9 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:
5a7e2c3
Parents:
5e394ecc
Message:

ext/py-musicutils.c: complete window implementation

Location:
python/ext
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/ext/py-musicutils.c

    r5e394ecc refa62ce  
    44Py_aubio_window(PyObject *self, PyObject *args)
    55{
    6   PyObject *output = NULL;
    76  char_t *wintype = NULL;
    87  uint_t winlen = 0;
    9   fvec_t *window;
     8  fvec_t *window = NULL;
    109
    11   if (!PyArg_ParseTuple (args, "|sd", &wintype, &winlen)) {
    12     PyErr_SetString (PyExc_ValueError,
    13         "failed parsing arguments");
     10  if (!PyArg_ParseTuple (args, "|sI", &wintype, &winlen)) {
     11    PyErr_SetString (PyExc_ValueError, "failed parsing arguments");
    1412    return NULL;
    1513  }
    1614
    17   //return (PyObject *) PyAubio_CFvecToArray(vec);
    18   Py_RETURN_NONE;
     15  window = new_aubio_window(wintype, winlen);
     16  if (window == NULL) {
     17    PyErr_SetString (PyExc_ValueError, "failed computing window");
     18    return NULL;
     19  }
     20
     21  return (PyObject *) PyAubio_CFvecToArray(window);
    1922}
  • python/ext/py-musicutils.h

    r5e394ecc refa62ce  
    1010"-------\n"
    1111"\n"
    12 ">>> window('hanningz', 1024)";
     12">>> window('hanningz', 1024)\n"
     13"array([  0.00000000e+00,   9.41753387e-06,   3.76403332e-05, ...,\n"
     14"         8.46982002e-05,   3.76403332e-05,   9.41753387e-06], dtype=float32)";
    1315
    1416PyObject * Py_aubio_window(PyObject *self, PyObject *args);
Note: See TracChangeset for help on using the changeset viewer.