Changeset b5bef11 for python/ext/py-musicutils.c
- Timestamp:
- Apr 21, 2016, 9:31:10 PM (8 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:
- a7f398d
- Parents:
- bfe8256
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/ext/py-musicutils.c
rbfe8256 rb5bef11 38 38 } 39 39 40 vec = PyAubio_ArrayToCFvec (input); 41 if (vec == NULL) { 40 vec = (fvec_t *)malloc(sizeof(fvec_t)); 41 if (!PyAubio_ArrayToCFvec(input, vec)) { 42 free(vec); 42 43 return NULL; 43 44 } 44 45 45 46 level_lin = Py_BuildValue("f", aubio_level_lin(vec)); 47 free(vec); 46 48 if (level_lin == NULL) { 47 49 PyErr_SetString (PyExc_ValueError, "failed computing level_lin"); … … 68 70 } 69 71 70 vec = PyAubio_ArrayToCFvec (input); 71 if (vec == NULL) { 72 vec = (fvec_t *)malloc(sizeof(fvec_t)); 73 if (!PyAubio_ArrayToCFvec(input, vec)) { 74 free(vec); 72 75 return NULL; 73 76 } 74 77 75 78 db_spl = Py_BuildValue("f", aubio_db_spl(vec)); 79 free(vec); 76 80 if (db_spl == NULL) { 77 81 PyErr_SetString (PyExc_ValueError, "failed computing db_spl"); … … 99 103 } 100 104 101 vec = PyAubio_ArrayToCFvec (input); 102 if (vec == NULL) { 105 vec = (fvec_t *)malloc(sizeof(fvec_t)); 106 if (!PyAubio_ArrayToCFvec(input, vec)) { 107 free(vec); 103 108 return NULL; 104 109 } 105 110 106 111 silence_detection = Py_BuildValue("I", aubio_silence_detection(vec, threshold)); 112 free(vec); 107 113 if (silence_detection == NULL) { 108 114 PyErr_SetString (PyExc_ValueError, "failed computing silence_detection"); … … 130 136 } 131 137 132 vec = PyAubio_ArrayToCFvec (input); 133 if (vec == NULL) { 138 vec = (fvec_t *)malloc(sizeof(fvec_t)); 139 if (!PyAubio_ArrayToCFvec(input, vec)) { 140 free(vec); 134 141 return NULL; 135 142 } 136 143 137 144 level_detection = Py_BuildValue("f", aubio_level_detection(vec, threshold)); 145 free(vec); 138 146 if (level_detection == NULL) { 139 147 PyErr_SetString (PyExc_ValueError, "failed computing level_detection");
Note: See TracChangeset
for help on using the changeset viewer.