Changeset 74c1fb9 for python


Ignore:
Timestamp:
Dec 19, 2018, 5:50:42 PM (5 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/timestretch, fix/ffmpeg5, master
Children:
0045668
Parents:
c1ba75b (diff), fda3394 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into feature/pytest

Location:
python
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • python/README.md

    rc1ba75b r74c1fb9  
    2828-----
    2929
    30 Some examples are available in the [`python/demos`][demos_dir] folder. Each
     30Some examples are available in the [`python/demos` folder][demos_dir]. Each
    3131script is a command line program which accepts one ore more argument.
    3232
  • python/ext/aubiomodule.c

    rc1ba75b r74c1fb9  
    224224
    225225  // compute the function
    226   result = Py_BuildValue (AUBIO_NPY_SMPL_CHR, fvec_alpha_norm (&vec, alpha));
     226  result = PyFloat_FromDouble(fvec_alpha_norm (&vec, alpha));
    227227  if (result == NULL) {
    228228    return NULL;
     
    320320
    321321  // compute the function
    322   result = Py_BuildValue (AUBIO_NPY_SMPL_CHR, aubio_zero_crossing_rate (&vec));
     322  result = PyFloat_FromDouble(aubio_zero_crossing_rate (&vec));
    323323  if (result == NULL) {
    324324    return NULL;
  • python/ext/py-cvec.c

    rc1ba75b r74c1fb9  
    137137  }
    138138
    139   args = Py_BuildValue ("I", self->length);
     139  args = PyLong_FromLong(self->length);
    140140  if (args == NULL) {
    141141    goto fail;
  • python/ext/py-musicutils.c

    rc1ba75b r74c1fb9  
    4040  }
    4141
    42   level_lin = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_level_lin(&vec));
     42  level_lin = PyFloat_FromDouble(aubio_level_lin(&vec));
    4343  if (level_lin == NULL) {
    4444    PyErr_SetString (PyExc_ValueError, "failed computing level_lin");
     
    6868  }
    6969
    70   db_spl = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_db_spl(&vec));
     70  db_spl = PyFloat_FromDouble(aubio_db_spl(&vec));
    7171  if (db_spl == NULL) {
    7272    PyErr_SetString (PyExc_ValueError, "failed computing db_spl");
     
    9797  }
    9898
    99   silence_detection = Py_BuildValue("I", aubio_silence_detection(&vec, threshold));
     99  silence_detection = PyLong_FromLong(aubio_silence_detection(&vec, threshold));
    100100  if (silence_detection == NULL) {
    101101    PyErr_SetString (PyExc_ValueError, "failed computing silence_detection");
     
    126126  }
    127127
    128   level_detection = Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_level_detection(&vec, threshold));
     128  level_detection = PyFloat_FromDouble(aubio_level_detection(&vec, threshold));
    129129  if (level_detection == NULL) {
    130130    PyErr_SetString (PyExc_ValueError, "failed computing level_detection");
     
    195195  }
    196196  if (htk != NULL && PyObject_IsTrue(htk) == 1)
    197     return Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_hztomel_htk(v));
     197    return PyFloat_FromDouble(aubio_hztomel_htk(v));
    198198  else
    199     return Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_hztomel(v));
     199    return PyFloat_FromDouble(aubio_hztomel(v));
    200200}
    201201
     
    212212  }
    213213  if (htk != NULL && PyObject_IsTrue(htk) == 1)
    214     return Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_meltohz_htk(v));
     214    return PyFloat_FromDouble(aubio_meltohz_htk(v));
    215215  else
    216     return Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_meltohz(v));
     216    return PyFloat_FromDouble(aubio_meltohz(v));
    217217}
    218218
     
    224224    return NULL;
    225225  }
    226   return Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_hztomel_htk(v));
     226  return PyFloat_FromDouble(aubio_hztomel_htk(v));
    227227}
    228228
     
    234234    return NULL;
    235235  }
    236   return Py_BuildValue(AUBIO_NPY_SMPL_CHR, aubio_meltohz_htk(v));
    237 }
     236  return PyFloat_FromDouble(aubio_meltohz_htk(v));
     237}
Note: See TracChangeset for help on using the changeset viewer.