Changeset 31a09d2 for python/ext/py-musicutils.c
- Timestamp:
- Jul 10, 2015, 2:26:27 AM (9 years ago)
- 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:
- 9c8c8a6
- Parents:
- 665b711
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-musicutils.c
r665b711 r31a09d2 81 81 return db_spl; 82 82 } 83 84 PyObject * 85 Py_aubio_silence_detection(PyObject *self, PyObject *args) 86 { 87 PyObject *input; 88 fvec_t *vec; 89 PyObject *silence_detection; 90 smpl_t threshold; 91 92 if (!PyArg_ParseTuple (args, "Of:silence_detection", &input, &threshold)) { 93 PyErr_SetString (PyExc_ValueError, "failed parsing arguments"); 94 return NULL; 95 } 96 97 if (input == NULL) { 98 return NULL; 99 } 100 101 vec = PyAubio_ArrayToCFvec (input); 102 if (vec == NULL) { 103 return NULL; 104 } 105 106 silence_detection = Py_BuildValue("I", aubio_silence_detection(vec, threshold)); 107 if (silence_detection == NULL) { 108 PyErr_SetString (PyExc_ValueError, "failed computing silence_detection"); 109 return NULL; 110 } 111 112 return silence_detection; 113 }
Note: See TracChangeset
for help on using the changeset viewer.