Changeset 08d07ce
- Timestamp:
- Jun 29, 2019, 1:14:08 PM (5 years ago)
- Branches:
- feature/cnn, feature/crepe, feature/timestretch, fix/ffmpeg5, master
- Children:
- 3a83821
- Parents:
- 9279ba0 (diff), 2244f00 (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. - Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
.travis.yml
r9279ba0 r08d07ce 77 77 - rubberband 78 78 - lcov 79 #update: true79 update: true 80 80 81 81 before_install: -
doc/binaries.rst
r9279ba0 r08d07ce 9 9 `windows <https://aubio.org/download#win>`_ 10 10 11 For Windows, aubio is also available from `vcpkg 12 <https://vcpkg.readthedocs.io/en/latest/examples/installing-and-using-packages/>`_. 13 11 14 To use aubio in a macOS or iOS application, see :ref:`xcode-frameworks-label`. 12 15 -
python/ext/aubio-docstrings.h
r9279ba0 r08d07ce 2 2 "dct(size=1024)\n"\ 3 3 "\n"\ 4 "Compute Discrete Fourier Trans orms of Type-II.\n"\4 "Compute Discrete Fourier Transforms of Type-II.\n"\ 5 5 "\n"\ 6 6 "Parameters\n"\ -
python/ext/py-fft.c
r9279ba0 r08d07ce 4 4 "fft(size=1024)\n" 5 5 "\n" 6 "Compute Fast Fourier Trans orms.\n"6 "Compute Fast Fourier Transforms.\n" 7 7 "\n" 8 8 "Parameters\n" -
python/ext/py-filter.c
r9279ba0 r08d07ce 157 157 err = aubio_filter_set_c_weighting (self->o, samplerate); 158 158 if (err > 0) { 159 PyErr_SetString (PyExc_ValueError, 160 "error when setting filter to C-weighting"); 159 if (PyErr_Occurred() == NULL) { 160 PyErr_SetString (PyExc_ValueError, 161 "error when setting filter to C-weighting"); 162 } else { 163 // change the RuntimeError into ValueError 164 PyObject *type, *value, *traceback; 165 PyErr_Fetch(&type, &value, &traceback); 166 Py_XDECREF(type); 167 type = PyExc_ValueError; 168 Py_XINCREF(type); 169 PyErr_Restore(type, value, traceback); 170 } 161 171 return NULL; 162 172 } … … 175 185 err = aubio_filter_set_a_weighting (self->o, samplerate); 176 186 if (err > 0) { 177 PyErr_SetString (PyExc_ValueError, 178 "error when setting filter to A-weighting"); 187 if (PyErr_Occurred() == NULL) { 188 PyErr_SetString (PyExc_ValueError, 189 "error when setting filter to A-weighting"); 190 } else { 191 // change the RuntimeError into ValueError 192 PyObject *type, *value, *traceback; 193 PyErr_Fetch(&type, &value, &traceback); 194 Py_XDECREF(type); 195 type = PyExc_ValueError; 196 Py_XINCREF(type); 197 PyErr_Restore(type, value, traceback); 198 } 179 199 return NULL; 180 200 } … … 193 213 err = aubio_filter_set_biquad (self->o, b0, b1, b2, a1, a2); 194 214 if (err > 0) { 195 PyErr_SetString (PyExc_ValueError, 196 "error when setting filter with biquad coefficients"); 215 if (PyErr_Occurred() == NULL) { 216 PyErr_SetString (PyExc_ValueError, 217 "error when setting filter with biquad coefficients"); 218 } else { 219 // change the RuntimeError into ValueError 220 PyObject *type, *value, *traceback; 221 PyErr_Fetch(&type, &value, &traceback); 222 Py_XDECREF(type); 223 type = PyExc_ValueError; 224 Py_XINCREF(type); 225 PyErr_Restore(type, value, traceback); 226 } 197 227 return NULL; 198 228 } -
python/ext/py-filterbank.c
r9279ba0 r08d07ce 327 327 PyObject *type, *value, *traceback; 328 328 PyErr_Fetch(&type, &value, &traceback); 329 PyErr_Restore(PyExc_ValueError, value, traceback); 329 Py_XDECREF(type); 330 type = PyExc_ValueError; 331 Py_XINCREF(type); 332 PyErr_Restore(type, value, traceback); 330 333 } 331 334 return NULL; … … 352 355 PyObject *type, *value, *traceback; 353 356 PyErr_Fetch(&type, &value, &traceback); 354 PyErr_Restore(PyExc_ValueError, value, traceback); 357 Py_XDECREF(type); 358 type = PyExc_ValueError; 359 Py_XINCREF(type); 360 PyErr_Restore(type, value, traceback); 355 361 } 356 362 return NULL; … … 381 387 PyObject *type, *value, *traceback; 382 388 PyErr_Fetch(&type, &value, &traceback); 383 PyErr_Restore(PyExc_ValueError, value, traceback); 389 Py_XDECREF(type); 390 type = PyExc_ValueError; 391 Py_XINCREF(type); 392 PyErr_Restore(type, value, traceback); 384 393 } 385 394 return NULL; … … 410 419 PyObject *type, *value, *traceback; 411 420 PyErr_Fetch(&type, &value, &traceback); 412 PyErr_Restore(PyExc_ValueError, value, traceback); 421 Py_XDECREF(type); 422 type = PyExc_ValueError; 423 Py_XINCREF(type); 424 PyErr_Restore(type, value, traceback); 413 425 } 414 426 return NULL; … … 464 476 PyObject *type, *value, *traceback; 465 477 PyErr_Fetch(&type, &value, &traceback); 466 PyErr_Restore(PyExc_ValueError, value, traceback); 478 Py_XDECREF(type); 479 type = PyExc_ValueError; 480 Py_XINCREF(type); 481 PyErr_Restore(type, value, traceback); 467 482 } 468 483 return NULL; … … 494 509 PyObject *type, *value, *traceback; 495 510 PyErr_Fetch(&type, &value, &traceback); 496 PyErr_Restore(PyExc_ValueError, value, traceback); 511 Py_XDECREF(type); 512 type = PyExc_ValueError; 513 Py_XINCREF(type); 514 PyErr_Restore(type, value, traceback); 497 515 } 498 516 return NULL; -
python/ext/py-sink.c
r9279ba0 r08d07ce 82 82 "\n" 83 83 "By default, the sink will be closed before being deleted.\n" 84 "Explicit ely closing a sink can be useful to control the number\n"84 "Explicitly closing a sink can be useful to control the number\n" 85 85 "of files simultaneously opened.\n" 86 86 ""; -
python/lib/gen_code.py
r9279ba0 r08d07ce 524 524 PyObject *type, *value, *traceback; 525 525 PyErr_Fetch(&type, &value, &traceback); 526 PyErr_Restore(PyExc_ValueError, value, traceback); 526 Py_XDECREF(type); 527 type = PyExc_ValueError; 528 Py_XINCREF(type); 529 PyErr_Restore(type, value, traceback); 527 530 }} 528 531 return NULL; -
python/lib/gen_external.py
r9279ba0 r08d07ce 122 122 proc = subprocess.Popen(cpp_cmd, 123 123 stderr=subprocess.PIPE, 124 stdout=subprocess.PIPE) 124 stdout=subprocess.PIPE, 125 universal_newlines=True) 125 126 assert proc, 'Proc was none' 126 127 cpp_output = proc.stdout.read() … … 128 129 if err_output: 129 130 print("Warning: preprocessor produced errors or warnings:\n%s" \ 130 % err_output .decode('utf8'))131 % err_output) 131 132 if not cpp_output: 132 133 raise_msg = "preprocessor output is empty! Running command " \ 133 134 + "\"%s\" failed" % " ".join(cpp_cmd) 134 135 if err_output: 135 raise_msg += " with stderr: \"%s\"" % err_output .decode('utf8')136 raise_msg += " with stderr: \"%s\"" % err_output 136 137 else: 137 138 raise_msg += " with no stdout or stderr" 138 139 raise Exception(raise_msg) 139 140 if not isinstance(cpp_output, list): 140 cpp_output = [l.strip() for l in cpp_output. decode('utf8').split('\n')]141 cpp_output = [l.strip() for l in cpp_output.split('\n')] 141 142 142 143 return cpp_output -
python/tests/test_hztomel.py
r9279ba0 r08d07ce 5 5 from numpy.testing import assert_equal, assert_almost_equal 6 6 from _tools import assert_warns 7 from utils import is32bit 7 8 import numpy as np 8 9 import aubio … … 10 11 from aubio import hztomel, meltohz 11 12 from aubio import hztomel_htk, meltohz_htk 12 13 13 14 14 class aubio_hztomel_test_case(TestCase): … … 18 18 assert_almost_equal(hztomel(400. / 3.), 2., decimal=5) 19 19 assert_almost_equal(hztomel(1000. / 3), 5.) 20 assert_equal(hztomel(200.), 3.) 20 # on 32bit, some of these tests fails unless compiling with -ffloat-store 21 try: 22 assert_equal(hztomel(200.), 3.) 23 except AssertionError: 24 if not is32bit(): raise 25 assert_almost_equal(hztomel(200.), 3., decimal=5) 21 26 assert_almost_equal(hztomel(1000.), 15) 22 assert_almost_equal(hztomel(6400), 42 )23 assert_almost_equal(hztomel(40960), 69 )27 assert_almost_equal(hztomel(6400), 42, decimal=5) 28 assert_almost_equal(hztomel(40960), 69, decimal=5) 24 29 25 30 for m in np.linspace(0, 1000, 100): … … 29 34 assert_equal(meltohz(0.), 0.) 30 35 assert_almost_equal(meltohz(2), 400. / 3., decimal=4) 31 assert_equal(meltohz(3.), 200.) 36 try: 37 assert_equal(meltohz(3.), 200.) 38 except AssertionError: 39 if not is32bit(): raise 40 assert_almost_equal(meltohz(3.), 200., decimal=5) 32 41 assert_almost_equal(meltohz(5), 1000. / 3., decimal=4) 33 42 assert_almost_equal(meltohz(15), 1000., decimal=4) -
python/tests/test_phasevoc.py
r9279ba0 r08d07ce 2 2 3 3 from numpy.testing import TestCase, assert_equal, assert_array_less 4 from _tools import parametrize 4 from _tools import parametrize, skipTest 5 5 from aubio import fvec, cvec, pvoc, float_type 6 6 import numpy as np … … 52 52 assert_equal (s.phas[s.phas < 0], -np.pi) 53 53 assert_equal (np.abs(s.phas[np.abs(s.phas) != np.pi]), 0) 54 s elf.skipTest('pvoc(fvec(%d)).phas != +0, ' % win_s \54 skipTest('pvoc(fvec(%d)).phas != +0, ' % win_s \ 55 55 + 'This is expected when using fftw3 on powerpc.') 56 56 assert_equal ( r, 0.) -
python/tests/utils.py
r9279ba0 r08d07ce 4 4 import re 5 5 import glob 6 import struct 6 7 import numpy as np 7 8 from tempfile import mkstemp 8 9 9 10 DEFAULT_SOUND = '22050Hz_5s_brownnoise.wav' 11 12 def is32bit(): 13 return struct.calcsize("P") * 8 == 32 10 14 11 15 def array_from_text_file(filename, dtype = 'float'): -
scripts/get_waf.sh
r9279ba0 r08d07ce 4 4 #set -x 5 5 6 WAFVERSION=2.0.1 46 WAFVERSION=2.0.17 7 7 WAFTARBALL=waf-$WAFVERSION.tar.bz2 8 8 WAFURL=https://waf.io/$WAFTARBALL
Note: See TracChangeset
for help on using the changeset viewer.