Changes in / [2f16966:3d73183]


Ignore:
Files:
1 added
21 edited

Legend:

Unmodified
Added
Removed
  • .travis.yml

    r2f16966 r3d73183  
    3939      os: osx
    4040      compiler: clang
    41       env: WAFOPTS="--enable-fat --disable-avcodec --disable-sndfile --disable-samplerate"
     41      env: WAFOPTS="--enable-fat --disable-avcodec --disable-sndfile"
    4242    - language: C
    4343      os: osx
    4444      compiler: clang
    45       env: WAFOPTS="--with-target-platform=ios --disable-avcodec --disable-sndfile --disable-samplerate" AUBIO_NOTESTS=1
     45      env: WAFOPTS="--with-target-platform=ios --disable-avcodec --disable-sndfile" AUBIO_NOTESTS=1
    4646    - language: C
    4747      os: osx
    4848      compiler: clang
    49       env: WAFOPTS="--with-target-platform=iosimulator --disable-avcodec --disable-sndfile --disable-samplerate" AUBIO_NOTESTS=1
     49      env: WAFOPTS="--with-target-platform=iosimulator --disable-avcodec --disable-sndfile" AUBIO_NOTESTS=1
    5050
    5151# use trusty
     
    7474    - libsndfile
    7575    - lcov
    76     update: true
     76    #update: true
    7777
    7878before_install:
  • ChangeLog

    r2f16966 r3d73183  
    1 2018-12-19 Paul Brossier <piem@aubio.org>
    2 
    3         [ Overview ]
    4 
    5         * VERSION: bump to 0.4.9
    6         * library: improve stability, fixing potential crashes and memory leaks on
    7         invalid arguments; improve library messages and reporting of system errors
    8         * tests/: major clean-up, check return codes, increase code coverage
    9         * python/tests/: switch to pytest (closes gh-163), check emitted warnings
    10         * python/: add pages to manual with brief descriptions of classes
    11 
    12         [ Fixes ]
    13 
    14         * security: improve arguments validation in new_aubio_filterbank (prevent
    15         possible null-pointer dereference on invalid n_filters, CVE-2018-19801),
    16         new_aubio-tempo (prevent possible buffer overflow, CVE-2018-19800), and
    17         new_aubio_onset (prevent null-pointer dereference, CVE-2018-19802). Thanks
    18         to Guoxiang Niu (@niugx), from the EaglEye Team for reporting these issues.
    19         * tempo: fix delay_ms methods
    20         * filterbank: fix aubio_filterbank_get_power (thanks to @romanbsd who
    21         also noticed this issue)
    22         * dct: creation fail on negative sizes or invalid accelerate radix,
    23         fix typo in error and warning messages, prevent possible memory leak
    24         * pitch: prevent null pointer dereference in yinfast, comment out unused
    25         functions in mcomb and yin, prevent possible leak in specacf
    26         * mfcc: always use dct module, strengthen input validation, change
    27         get_{scale,power} to return smpl_t
    28         * specdesc: improve error message
    29         * notes: prevent null pointer dereference
    30         * hist: add validation for size argument, prevent possible leak
    31         * awhitening: use shortest length available (closes gh-216)
    32         * io: add macros to display system errors, add helpers to validate input
    33         arguments of source and sink methods, always clean-up after failure
    34         * source: validate input sizes to prevent invalid reads
    35         * apple_audio: use native format conversions in source and sink, prevent
    36         possible apple_audio crash on empty string, get_duration returns 0 on failure
    37         * ffmpeg/avcodec: prevent deprecation warnings, read after close, and skipped
    38         samples warnings, improve warning messages, only show a warning when
    39         swr_convert failed, prevent possible memory leak when closing swr context
    40         * wavwrite: copy to all channels if needed, check fseek and fwrite return
    41         values, call fflush in open to return failure on full disk-system
    42         * source_sndfile: fix reading sizes when resampling, set error message when
    43         reading after close
    44         * aubio_priv.h: include blas first (see gh-225), add STRERROR macros
    45 
    46         [ Python ]
    47 
    48         * documentation: add pages to manual, add minimal docstrings for fft,
    49         digital_filter, and generated objects, improve specdesc documentation
    50         * filterbank: add get_norm/power documentation
    51         * source: take a copy of the last frame before resizing it, raise an
    52         exception when read failed, fix compilation warning
    53         * fixes: remove unneeded check convert with PyFloat_FromDouble or
    54         PyFloat_FromDouble, check if sink, digital_filter, were created before
    55         deleting
    56 
    57         [ Tests ]
    58 
    59         * python/tests/: switch to pytest (slightly slower than nose2 but better at
    60         capturing warnings and parametrization), improve coding style and coverage.
    61         Tests should now be run with `pytest`.
    62         * tests/: Each test program in C must now return 0, otherwise the test will
    63         fail. Examples have been modified to run themselves on a test audio file,
    64         but can still be run with arguments. Tests for `source` and `sink` have been
    65         factorised, and some code cleaning. A python script is used to create a
    66         test sound file. Tested on linux, macos, and windows, improvements to
    67         test-mfcc (closes gh-219).
    68 
    69         [ Build system ]
    70 
    71         * waf: upgrade to 2.0.14, check the return code of each test program,
    72         update rules to build manual and api documentation into build/, check
    73         for errno.h
    74         * osx: use -Os in scripts/build_apple_frameworks
    75         * Makefile: improve coverage reports
    76         * appveyor, travis, circleci: switch to pytest, set one travis config to use
    77         sndfile only
    78         * travis: add py3.6, drop py3.4, use py3.5 to test debug mode
    79         * azure: add basic configuration
    80 
    8112018-11-21 Paul Brossier <piem@aubio.org>
    822
  • README.md

    r2f16966 r3d73183  
    44[![Travis build status](https://travis-ci.org/aubio/aubio.svg?branch=master)](https://travis-ci.org/aubio/aubio "Travis build status")
    55[![Appveyor build status](https://img.shields.io/appveyor/ci/piem/aubio/master.svg)](https://ci.appveyor.com/project/piem/aubio "Appveyor build status")
     6[![Landscape code health](https://landscape.io/github/aubio/aubio/master/landscape.svg?style=flat)](https://landscape.io/github/aubio/aubio/master "Landscape code health")
    67[![Commits since last release](https://img.shields.io/github/commits-since/aubio/aubio/latest.svg)](https://github.com/aubio/aubio "Commits since last release")
    78
  • VERSION

    r2f16966 r3d73183  
    11AUBIO_MAJOR_VERSION=0
    2 AUBIO_MINOR_VERSION=5
    3 AUBIO_PATCH_VERSION=0
     2AUBIO_MINOR_VERSION=4
     3AUBIO_PATCH_VERSION=9
    44AUBIO_VERSION_STATUS='~alpha'
    55LIBAUBIO_LT_CUR=5
  • azure-pipelines.yml

    r2f16966 r3d73183  
    44- job: linux
    55  pool:
    6     vmImage: 'ubuntu-16.04'
     6    vmImage: 'Ubuntu 16.04'
    77  steps:
    88  - script: |
     
    1414- job: windows
    1515  pool:
    16     vmImage: 'vs2017-win2016'
     16    vmIMage: 'VS2017-Win2016'
    1717  steps:
    1818  - script: |
     
    2525- job: macos
    2626  pool:
    27     vmImage: 'macos-10.13'
     27    vmIMage: macOS-10.13
    2828  steps:
    2929  - script: |
  • doc/binaries.rst

    r2f16966 r3d73183  
    99`windows <https://aubio.org/download#win>`_
    1010
    11 For Windows, aubio is also available from `vcpkg
    12 <https://vcpkg.readthedocs.io/en/latest/examples/installing-and-using-packages/>`_.
    13 
    1411To use aubio in a macOS or iOS application, see :ref:`xcode-frameworks-label`.
    1512
  • doc/statuslinks.rst

    r2f16966 r3d73183  
    1010   :alt: Appveyor build status
    1111
     12.. image:: https://landscape.io/github/aubio/aubio/master/landscape.svg?style=flat
     13   :target: https://landscape.io/github/aubio/aubio/master
     14   :alt: Landscape code health
     15
    1216.. image:: https://readthedocs.org/projects/aubio/badge/?version=latest
    1317   :target: https://aubio.readthedocs.io/en/latest/?badge=latest
  • python/demos/demo_wav2midi.py

    r2f16966 r3d73183  
    6464        if new_note[2] > 0:
    6565            track.append(Message('note_off', note=int(new_note[2]),
    66                 velocity=127, time=delta)
     66                velocity=127, time=0)
    6767                )
    6868        track.append(Message('note_on',
  • python/ext/aubio-docstrings.h

    r2f16966 r3d73183  
    22    "dct(size=1024)\n"\
    33    "\n"\
    4     "Compute Discrete Fourier Transforms of Type-II.\n"\
     4    "Compute Discrete Fourier Transorms of Type-II.\n"\
    55    "\n"\
    66    "Parameters\n"\
  • python/ext/py-fft.c

    r2f16966 r3d73183  
    44"fft(size=1024)\n"
    55"\n"
    6 "Compute Fast Fourier Transforms.\n"
     6"Compute Fast Fourier Transorms.\n"
    77"\n"
    88"Parameters\n"
  • python/ext/py-filter.c

    r2f16966 r3d73183  
    157157  err = aubio_filter_set_c_weighting (self->o, samplerate);
    158158  if (err > 0) {
    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     }
     159    PyErr_SetString (PyExc_ValueError,
     160        "error when setting filter to C-weighting");
    171161    return NULL;
    172162  }
     
    185175  err = aubio_filter_set_a_weighting (self->o, samplerate);
    186176  if (err > 0) {
    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     }
     177    PyErr_SetString (PyExc_ValueError,
     178        "error when setting filter to A-weighting");
    199179    return NULL;
    200180  }
     
    213193  err = aubio_filter_set_biquad (self->o, b0, b1, b2, a1, a2);
    214194  if (err > 0) {
    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     }
     195    PyErr_SetString (PyExc_ValueError,
     196        "error when setting filter with biquad coefficients");
    227197    return NULL;
    228198  }
  • python/ext/py-filterbank.c

    r2f16966 r3d73183  
    327327      PyObject *type, *value, *traceback;
    328328      PyErr_Fetch(&type, &value, &traceback);
    329       Py_XDECREF(type);
    330       type = PyExc_ValueError;
    331       Py_XINCREF(type);
    332       PyErr_Restore(type, value, traceback);
     329      PyErr_Restore(PyExc_ValueError, value, traceback);
    333330    }
    334331    return NULL;
     
    355352      PyObject *type, *value, *traceback;
    356353      PyErr_Fetch(&type, &value, &traceback);
    357       Py_XDECREF(type);
    358       type = PyExc_ValueError;
    359       Py_XINCREF(type);
    360       PyErr_Restore(type, value, traceback);
     354      PyErr_Restore(PyExc_ValueError, value, traceback);
    361355    }
    362356    return NULL;
     
    387381      PyObject *type, *value, *traceback;
    388382      PyErr_Fetch(&type, &value, &traceback);
    389       Py_XDECREF(type);
    390       type = PyExc_ValueError;
    391       Py_XINCREF(type);
    392       PyErr_Restore(type, value, traceback);
     383      PyErr_Restore(PyExc_ValueError, value, traceback);
    393384    }
    394385    return NULL;
     
    419410      PyObject *type, *value, *traceback;
    420411      PyErr_Fetch(&type, &value, &traceback);
    421       Py_XDECREF(type);
    422       type = PyExc_ValueError;
    423       Py_XINCREF(type);
    424       PyErr_Restore(type, value, traceback);
     412      PyErr_Restore(PyExc_ValueError, value, traceback);
    425413    }
    426414    return NULL;
     
    476464      PyObject *type, *value, *traceback;
    477465      PyErr_Fetch(&type, &value, &traceback);
    478       Py_XDECREF(type);
    479       type = PyExc_ValueError;
    480       Py_XINCREF(type);
    481       PyErr_Restore(type, value, traceback);
     466      PyErr_Restore(PyExc_ValueError, value, traceback);
    482467    }
    483468    return NULL;
     
    509494      PyObject *type, *value, *traceback;
    510495      PyErr_Fetch(&type, &value, &traceback);
    511       Py_XDECREF(type);
    512       type = PyExc_ValueError;
    513       Py_XINCREF(type);
    514       PyErr_Restore(type, value, traceback);
     496      PyErr_Restore(PyExc_ValueError, value, traceback);
    515497    }
    516498    return NULL;
  • python/ext/py-sink.c

    r2f16966 r3d73183  
    8282"\n"
    8383"By default, the sink will be closed before being deleted.\n"
    84 "Explicitly closing a sink can be useful to control the number\n"
     84"Explicitely closing a sink can be useful to control the number\n"
    8585"of files simultaneously opened.\n"
    8686"";
  • python/lib/gen_code.py

    r2f16966 r3d73183  
    510510      PyObject *type, *value, *traceback;
    511511      PyErr_Fetch(&type, &value, &traceback);
    512       Py_XDECREF(type);
    513       type = PyExc_ValueError;
    514       Py_XINCREF(type);
    515       PyErr_Restore(type, value, traceback);
     512      PyErr_Restore(PyExc_ValueError, value, traceback);
    516513    }}
    517514    return NULL;
  • python/lib/gen_external.py

    r2f16966 r3d73183  
    121121    proc = subprocess.Popen(cpp_cmd,
    122122                            stderr=subprocess.PIPE,
    123                             stdout=subprocess.PIPE,
    124                             universal_newlines=True)
     123                            stdout=subprocess.PIPE)
    125124    assert proc, 'Proc was none'
    126125    cpp_output = proc.stdout.read()
     
    128127    if err_output:
    129128        print("Warning: preprocessor produced errors or warnings:\n%s" \
    130                 % err_output)
     129                % err_output.decode('utf8'))
    131130    if not cpp_output:
    132131        raise_msg = "preprocessor output is empty! Running command " \
    133132                + "\"%s\" failed" % " ".join(cpp_cmd)
    134133        if err_output:
    135             raise_msg += " with stderr: \"%s\"" % err_output
     134            raise_msg += " with stderr: \"%s\"" % err_output.decode('utf8')
    136135        else:
    137136            raise_msg += " with no stdout or stderr"
    138137        raise Exception(raise_msg)
    139138    if not isinstance(cpp_output, list):
    140         cpp_output = [l.strip() for l in cpp_output.split('\n')]
     139        cpp_output = [l.strip() for l in cpp_output.decode('utf8').split('\n')]
    141140
    142141    return cpp_output
  • python/tests/test_hztomel.py

    r2f16966 r3d73183  
    55from numpy.testing import assert_equal, assert_almost_equal
    66from _tools import assert_warns
    7 from utils import is32bit
    87import numpy as np
    98import aubio
     
    1110from aubio import hztomel, meltohz
    1211from aubio import hztomel_htk, meltohz_htk
     12
    1313
    1414class aubio_hztomel_test_case(TestCase):
     
    1818        assert_almost_equal(hztomel(400. / 3.), 2., decimal=5)
    1919        assert_almost_equal(hztomel(1000. / 3), 5.)
    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)
     20        assert_equal(hztomel(200.), 3.)
    2621        assert_almost_equal(hztomel(1000.), 15)
    27         assert_almost_equal(hztomel(6400), 42, decimal=5)
    28         assert_almost_equal(hztomel(40960), 69, decimal=5)
     22        assert_almost_equal(hztomel(6400), 42)
     23        assert_almost_equal(hztomel(40960), 69)
    2924
    3025        for m in np.linspace(0, 1000, 100):
     
    3429        assert_equal(meltohz(0.), 0.)
    3530        assert_almost_equal(meltohz(2), 400. / 3., decimal=4)
    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)
     31        assert_equal(meltohz(3.), 200.)
    4132        assert_almost_equal(meltohz(5), 1000. / 3., decimal=4)
    4233        assert_almost_equal(meltohz(15), 1000., decimal=4)
  • python/tests/test_phasevoc.py

    r2f16966 r3d73183  
    22
    33from numpy.testing import TestCase, assert_equal, assert_array_less
    4 from _tools import parametrize, skipTest
     4from _tools import parametrize
    55from aubio import fvec, cvec, pvoc, float_type
    66import numpy as np
     
    5252                assert_equal (s.phas[s.phas < 0], -np.pi)
    5353                assert_equal (np.abs(s.phas[np.abs(s.phas) != np.pi]), 0)
    54                 skipTest('pvoc(fvec(%d)).phas != +0, ' % win_s \
     54                self.skipTest('pvoc(fvec(%d)).phas != +0, ' % win_s \
    5555                        + 'This is expected when using fftw3 on powerpc.')
    5656            assert_equal ( r, 0.)
  • python/tests/utils.py

    r2f16966 r3d73183  
    44import re
    55import glob
    6 import struct
    76import numpy as np
    87from tempfile import mkstemp
    98
    109DEFAULT_SOUND = '22050Hz_5s_brownnoise.wav'
    11 
    12 def is32bit():
    13     return struct.calcsize("P") * 8 == 32
    1410
    1511def array_from_text_file(filename, dtype = 'float'):
  • scripts/get_waf.sh

    r2f16966 r3d73183  
    44#set -x
    55
    6 WAFVERSION=2.0.17
     6WAFVERSION=2.0.13
    77WAFTARBALL=waf-$WAFVERSION.tar.bz2
    88WAFURL=https://waf.io/$WAFTARBALL
  • tests/src/spectral/test-mfcc.c

    r2f16966 r3d73183  
    3434  aubio_mfcc_t *mfcc = 0;
    3535
    36   fvec_t *in = new_fvec (hop_s);       // phase vocoder input
    37   cvec_t *fftgrain = new_cvec (win_s); // pvoc output / mfcc input
    38   fvec_t *out = new_fvec (n_coeffs);   // mfcc output
     36  fvec_t *in = new_fvec (win_s); // input buffer
     37  cvec_t *fftgrain = new_cvec (win_s); // input buffer
     38  fvec_t *out = new_fvec (n_coeffs); // output coefficients
    3939
    4040  if (!in || !fftgrain || !out) { err = 1; goto failure; }
  • wscript

    r2f16966 r3d73183  
    634634    ctx.excl += ' **/.cache'
    635635    ctx.excl += ' **/**.zip **/**.tar.bz2'
    636     ctx.excl += ' **.tar.bz2**'
     636    ctx.excl += ' **.tar.bz2'
    637637    ctx.excl += ' **/doc/full/* **/doc/web/*'
    638638    ctx.excl += ' **/doc/full.cfg'
     
    646646    ctx.excl += ' **/.DS_Store'
    647647    ctx.excl += ' **/.travis.yml'
     648    ctx.excl += ' **/.landscape.yml'
    648649    ctx.excl += ' **/.appveyor.yml'
    649650    ctx.excl += ' **/.circleci/*'
Note: See TracChangeset for help on using the changeset viewer.