Changeset 911b175d


Ignore:
Timestamp:
Mar 26, 2017, 1:31:48 PM (7 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/pydocstrings, feature/timestretch, fix/ffmpeg5, master, sampler
Children:
7928b3b8
Parents:
1136442 (diff), 2a7bcaa (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 awhitening

Files:
4 added
18 edited
1 moved

Legend:

Unmodified
Added
Removed
  • .gitignore

    r1136442 r911b175d  
    3939python/*.wav
    4040
     41pip-delete-this-directory.txt
     42
    4143aubio-*.tar.bz2
    4244aubio-*.zip
     45dist/*.tar.gz
    4346
    4447# test sounds
  • MANIFEST.in

    r1136442 r911b175d  
    11include AUTHORS COPYING README.md VERSION ChangeLog
    22include python/README.md
     3include this_version.py
    34include Makefile wscript */wscript_build
    45include waf waflib/* waflib/*/*
  • README.md

    r1136442 r911b175d  
    1 aubio library
    2 =============
     1aubio
     2=====
     3
     4[![Travis build status](https://travis-ci.org/aubio/aubio.svg?branch=master)](https://travis-ci.org/aubio/aubio "Travis build status")
     5[![Appveyor build status](https://ci.appveyor.com/api/projects/status/f3lhy3a57rkgn5yi?svg=true)](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")
     7[![Documentation Status](https://readthedocs.org/projects/aubio/badge/?version=latest)](http://aubio.readthedocs.io/en/latest/?badge=latest "Documentation status")
     8[![Commits since last release](https://img.shields.io/github/commits-since/aubio/aubio/0.4.4.svg?maxAge=2592000)](https://github.com/aubio/aubio "Commits since last release")
    39
    410aubio is a library to label music and sounds. It listens to audio signals and
     
    5157 - `aubiocut` slices sound files at onset or beat timestamps
    5258
    53 Implementation and Design Basics
    54 --------------------------------
    55 
    56 The library is written in C and is optimised for speed and portability.
    57 
    58 The C API is designed in the following way:
    59 
    60     aubio_something_t * new_aubio_something (void * args);
    61     audio_something_do (aubio_something_t * t, void * args);
    62     smpl_t aubio_something_get_a_parameter (aubio_something_t *t);
    63     uint_t aubio_something_set_a_parameter (aubio_something_t *t, smpl_t a_parameter);
    64     void del_aubio_something (aubio_something_t * t);
    65 
    66 For performance and real-time operation, no memory allocation or freeing take
    67 place in the `_do` methods. Instead, memory allocation should always take place
    68 in the `new_` methods, whereas free operations are done in the `del_` methods.
    69 
    7059The latest version of the documentation can be found at:
    7160
     
    7564------------------
    7665
    77 A number of distributions already include aubio. Check your favorite package
    78 management system, or have a look at the [download
    79 page](https://aubio.org/download).
    80 
    81 aubio uses [waf](https://waf.io/) to configure, compile, and test the source:
    82 
    83     ./waf configure
    84     ./waf build
    85 
    86 If waf is not found in the directory, you can download and install it with:
    87 
    88     make getwaf
    89 
    9066aubio compiles on Linux, Mac OS X, Windows, Cygwin, and iOS.
    9167
    92 Installation
    93 ------------
     68To compile aubio, you should be able to simply run:
    9469
    95 To install aubio library and headers on your system, use:
     70    make
    9671
    97     sudo ./waf install
     72To compile the python module:
    9873
    99 To uninstall:
     74    ./setup.py build
    10075
    101     sudo ./waf uninstall
    102 
    103 If you don't have root access to install libaubio on your system, you can use
    104 libaubio without installing libaubio either by setting `LD_LIBRARY_PATH`, or by
    105 copying it to `~/lib`.
    106 
    107 On Linux, you should be able to set `LD_LIBRARY_PATH` with:
    108 
    109     $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/build/src
    110 
    111 On Mac OS X, a copy or a symlink can be made in `~/lib`:
    112 
    113     $ mkdir -p ~/lib
    114     $ ln -sf $PWD/build/src/libaubio*.dylib ~/lib/
    115 
    116 Note on Mac OS X systems older than El Capitan (10.11), the `DYLD_LIBRARY_PATH`
    117 variable can be set as follows:
    118 
    119     $ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/build/src
     76See also the [manual](https://aubio.org/manual/latest/) for more information
     77about [compiling](https://aubio.org/manual/latest/building.html) and
     78[installing](https://aubio.org/manual/latest/installing.html).
    12079
    12180Credits and Publications
  • doc/android.rst

    r1136442 r911b175d  
    11.. _android:
    22
    3 Building aubio for Android
    4 --------------------------
     3Android build
     4-------------
    55
    66To compile aubio for android, you will need to get the `Android Native
  • doc/building.rst

    r1136442 r911b175d  
    2121The **latest stable release** can be downloaded from https://aubio.org/download::
    2222
    23         $ curl -O http://aubio.org/pub/aubio-0.4.3.tar.bz2
    24         $ tar xf aubio-0.4.3.tar.bz2
    25         $ cd aubio-0.4.3
     23        $ curl -O http://aubio.org/pub/aubio-<version>.tar.bz2
     24        $ tar xf aubio-<version>.tar.bz2
     25        $ cd aubio-<version>/
    2626
    2727Git repository
     
    3131
    3232        $ git clone git://git.aubio.org/git/aubio
    33         $ cd aubio
     33        $ cd aubio/
    3434
    3535The following command will fetch the correct `waf`_ version (not included in
     
    7474       $ waf configure build
    7575
     76
     77Running as a user
     78-----------------
     79
     80To use aubio without actually installing, for instance if you don't have root
     81access to install libaubio on your system,
     82
     83On Linux or macOS, sourcing the script ``scripts/setenv_local.sh`` should help::
     84
     85       $ source ./scripts/setenv_local.sh
     86
     87This script sets ``LD_LIBRARY_PATH``, for libaubio, and ``PYTHONPATH`` for the
     88python module.
     89
     90On Linux, you should be able to set ``LD_LIBRARY_PATH`` with::
     91
     92        $ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/build/src
     93
     94On Mac OS X, a copy or a symlink can be made in ``~/lib``::
     95
     96        $ mkdir -p ~/lib
     97        $ ln -sf $PWD/build/src/libaubio*.dylib ~/lib/
     98
     99Note on Mac OS X systems older than El Capitan (10.11), the ``DYLD_LIBRARY_PATH``
     100variable can be set as follows::
     101
     102        $ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/build/src
     103
    76104Cleaning
    77105--------
     
    95123.. _Git Bash: https://git-for-windows.github.io/
    96124
    97 .. toctree::
    98    :maxdepth: 2
     125.. _xcode-frameworks-label:
     126
     127.. include:: xcode_frameworks.rst
     128
     129.. include:: android.rst
  • doc/cli.rst

    r1136442 r911b175d  
    44==================
    55
    6 A few simple command line tools are included along with the library.
     6The python module comes with the following tools:
     7
     8 - ``aubio`` estimate and extract descriptors from sound files
     9 - ``aubiocut`` slices sound files at onset or beat timestamps
     10
     11More command line tools are included along with the library.
    712
    813 - ``aubioonset`` outputs the time stamp of detected note onsets
     
    1419 - ``aubioquiet`` extracts quiet and loud regions
    1520
    16 Additionally, the python module comes with the following script:
    1721
    18  - ``aubiocut`` slices sound files at onset or beat timestamps
     22``aubio``
     23---------
     24
     25.. literalinclude:: aubio.txt
     26   :language: text
    1927
    2028
    21 .. toctree::
     29``aubiocut``
     30--------------
    2231
    23    cli_features
     32.. literalinclude:: aubiocut.txt
     33   :language: text
    2434
    2535
     
    2838
    2939.. literalinclude:: aubioonset.txt
     40   :language: text
    3041
    3142``aubiopitch``
     
    3344
    3445.. literalinclude:: aubiopitch.txt
     46   :language: text
    3547
    3648``aubiomfcc``
     
    3850
    3951.. literalinclude:: aubiomfcc.txt
     52   :language: text
    4053
    4154``aubiotrack``
     
    4356
    4457.. literalinclude:: aubiotrack.txt
     58   :language: text
    4559
    4660``aubionotes``
     
    4862
    4963.. literalinclude:: aubionotes.txt
     64   :language: text
    5065
    5166``aubioquiet``
     
    5368
    5469.. literalinclude:: aubioquiet.txt
     70   :language: text
    5571
    56 ``aubiocut``
    57 --------------
    5872
    59 .. literalinclude:: aubiocut.txt
     73.. include:: cli_features.rst
  • doc/cli_features.rst

    r1136442 r911b175d  
    11Command line features
    2 =====================
     2---------------------
    33
    44+--------------+-------+-------+------+-------+-------+-------+------+------------------+
  • doc/conf.py

    r1136442 r911b175d  
    1313
    1414import sys, os
     15
     16# get version using this_version.py
     17sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
     18from this_version import get_aubio_version
    1519
    1620# If extensions (or modules to document with autodoc) are in another directory,
     
    4953#
    5054# The short X.Y version.
    51 version = '0.4'
     55
     56version = get_aubio_version()[:3]
    5257# The full version, including alpha/beta/rc tags.
    53 release = '0.4.5~alpha'
     58release = get_aubio_version()
    5459
    5560# The language for content autogenerated by Sphinx. Refer to documentation
     
    6570# List of patterns, relative to source directory, that match files and
    6671# directories to ignore when looking for source files.
    67 exclude_patterns = ['_build']
     72exclude_patterns = ['_build',
     73        'statuslinks.rst',
     74        'download.rst',
     75        'binaries.rst',
     76        'debian_packages.rst',
     77        'building.rst',
     78        'android.rst',
     79        'xcode_frameworks.rst',
     80        'requirements.rst',
     81        'cli_features.rst',
     82        ]
    6883
    6984# The reST default role (used for this markup: `text`) to use for all documents.
  • doc/develop.rst

    r1136442 r911b175d  
    44======================
    55
    6 Read `Contribute`_ to report issues and request new features.
     6Here is a brief overview of the C library.
    77
    8 See `Doxygen documentation`_ for the complete documentation of the C library,
    9 built using `Doxygen <http://www.doxygen.org/>`_.
     8For a more detailed list of available functions, see the `API documentation
     9<https://aubio.org/doc/latest/>`_.
    1010
    11 Below is a brief `Library overview`_.
     11To report issues, ask questions, and request new features, use `Github Issues
     12<https://github.com/aubio/aubio/issues>`_
    1213
    13 Library overview
    14 ----------------
     14Design Basics
     15-------------
    1516
    16 Here is a brief overview of the C library. See also the `Doxygen
    17 documentation`_ for a more detailed list of available functions.
     17The library is written in C and is optimised for speed and portability.
    1818
    19 Vectors and matrix
    20 ``````````````````
    21 
    22 ``fvec_t`` are used to hold vectors of float (``smpl_t``).
    23 
    24 .. literalinclude:: ../tests/src/test-fvec.c
    25    :language: C
    26    :lines: 7
    27 
     19All memory allocations take place in the `new_` methods. Each successful call
     20to `new_` should have a matching call to `del_` to deallocate the object.
    2821
    2922.. code-block:: C
    3023
    31         // set some elements
    32         vec->data[511] = 2.;
    33         vec->data[vec->length-2] = 1.;
     24   // new_ to create an object foobar
     25   aubio_foobar_t * new_aubio_foobar(void * args);
     26   // del_ to delete foobar
     27   void del_aubio_foobar (aubio_foobar_t * foobar);
    3428
    35 Similarly, ``fmat_t`` are used to hold matrix of floats.
     29The main computations are done in the `_do` methods.
    3630
    37 .. literalinclude:: ../tests/src/test-fmat.c
    38    :language: C
    39    :lines: 9-19
     31.. code-block:: C
     32
     33   // _do to process output = foobar(input)
     34   audio_foobar_do (aubio_foobar_t * foobar, fvec_t * input, cvec_t * output);
     35
     36Most parameters can be read and written at any time:
     37
     38.. code-block:: C
     39
     40   // _get_param to get foobar.param
     41   smpl_t aubio_foobar_get_a_parameter (aubio_foobar_t * foobar);
     42   // _set_param to set foobar.param
     43   uint_t aubio_foobar_set_a_parameter (aubio_foobar_t * foobar, smpl_t a_parameter);
     44
     45In some case, more functions are available:
     46
     47.. code-block:: C
     48
     49   // non-real time functions
     50   uint_t aubio_foobar_reset(aubio_foobar_t * t);
     51
     52Basic Types
     53-----------
     54
     55.. code-block:: C
     56
     57    // integers
     58    uint_t n = 10;                 // unsigned
     59    sint_t delay = -90;            // signed
     60
     61    // float
     62    smpl_t a = -90.;               // simple precision
     63    lsmp_t f = 0.024;              // double precision
     64
     65    // vector of floats (simple precision)
     66    fvec_t * vec = new_fvec(n);
     67    vec->data[0] = 1;
     68    vec->data[vec->length-1] = 1.; // vec->data has n elements
     69    fvec_print(vec);
     70    del_fvec(vec);
     71
     72    // complex data
     73    cvec_t * fftgrain = new_cvec(n);
     74    vec->norm[0] = 1.;             // vec->norm has n/2+1 elements
     75    vec->phas[n/2] = 3.1415;       // vec->phas as well
     76    del_cvec(fftgrain);
     77
     78    // matrix
     79    fmat_t * mat = new_fmat (height, length);
     80    mat->data[height-1][0] = 1;    // mat->data has height rows
     81    mat->data[0][length-1] = 10;   // mat->data[0] has length columns
     82    del_fmat(mat);
     83
    4084
    4185Reading a sound file
    42 ````````````````````
    43 In this example, ``aubio_source`` is used to read a media file.
     86--------------------
    4487
    45 First, create the objects we need.
     88In this example, `aubio_source <https://aubio.org/doc/latest/source_8h.html>`_
     89is used to read a media file.
     90
     91First, define a few variables and allocate some memory.
    4692
    4793.. literalinclude:: ../tests/src/io/test-source.c
     
    59105   :lines: 40-44
    60106
    61 At the end of the processing loop, clean-up and de-allocate memory:
     107At the end of the processing loop, memory is deallocated:
    62108
    63109.. literalinclude:: ../tests/src/io/test-source.c
    64110   :language: C
    65    :lines: 50-56
     111   :lines: 55-56
    66112
    67113See the complete example: :download:`test-source.c
    68114<../tests/src/io/test-source.c>`.
    69115
    70 Computing the spectrum
    71 ``````````````````````
     116Computing a spectrum
     117--------------------
    72118
    73119Now let's create a phase vocoder:
     
    81127.. literalinclude:: ../tests/src/spectral/test-phasevoc.c
    82128   :language: C
    83    :lines: 21-35
     129   :lines: 20-37
     130
     131Time to clean up the previously allocated memory:
     132
     133.. literalinclude:: ../tests/src/spectral/test-phasevoc.c
     134   :language: C
     135   :lines: 39-44
    84136
    85137See the complete example: :download:`test-phasevoc.c
     
    91143---------------------
    92144
    93 The latest version of the doxygen documentation is available at:
     145The latest version of the API documentation is built using `Doxygen
     146<http://www.doxygen.org/>`_ and is available at:
    94147
    95     https://aubio.org/doc/latest
     148    https://aubio.org/doc/latest/
    96149
    97150Contribute
     
    100153Please report any issue and feature request at the `Github issue tracker
    101154<https://github.com/aubio/aubio/issues>`_. Patches and pull-requests welcome!
    102 
  • doc/download.rst

    r1136442 r911b175d  
    88<https://aubio.org/download>`_ for more options.
    99
    10 To use aubio in a macOS or iOS application, see :ref:`xcode-frameworks-label`.
    11 
    1210To use aubio in an android project, see :ref:`android`.
    1311
    14 .. toctree::
     12To compile aubio from source, read :ref:`building`.
    1513
    16   debian_packages
    17   xcode_frameworks
    18   android
     14.. include:: binaries.rst
    1915
    20 To compile aubio from source, read :ref:`building`.
     16.. include:: debian_packages.rst
  • doc/installing.rst

    r1136442 r911b175d  
    55operating systems.
    66
    7 To download a pre-compiled version of the library, head to :ref:`download`.
     7Aubio is available as a C library and as a python module.
    88
    9 To install the python extension, head to :ref:`python`.
     9Cheat sheet
     10-----------
    1011
    11 To compile aubio form source, first check the :ref:`requirements`, then read
    12 :ref:`building`.
     12- :ref:`get aubio latest source code <building>`::
    1313
    14 .. toctree::
    15    :maxdepth: 2
     14    # official repo
     15    git clone https://git.aubio.org/aubio/aubio
     16    # mirror
     17    git clone https://github.com/aubio/aubio
     18    # latest release
     19    wget https://aubio.org/pub/aubio-<version>.tar.gz
    1620
    17    download
    18    building
    19    requirements
     21
     22- :ref:`build aubio from source <building>`::
     23
     24    # 1. simple
     25    cd aubio
     26    make
     27
     28    # 2. step by step
     29    ./scripts/get_waf.sh
     30    ./waf configure
     31    ./waf build
     32    sudo ./waf install
     33
     34- :ref:`install python-aubio from source <python>`::
     35
     36    # from git
     37    pip install git+https://git.aubio.org/aubio/aubio/
     38    # mirror
     39    pip install git+https://github.com/aubio/aubio/
     40    # from latest release
     41    pip install https://aubio.org/pub/aubio-latest.tar.bz2
     42    # from pypi
     43    pip install aubio
     44    # from source directory
     45    cd aubio
     46    pip install -v .
     47
     48- :ref:`install python-aubio from a pre-compiled binary <python>`::
     49
     50      # conda [osx, linux, win]
     51      conda install -c conda-forge aubio
     52      # .deb (debian, ubuntu) [linux]
     53      sudo apt-get install python3-aubio python-aubio aubio-tools
     54      # brew [osx]
     55      brew install aubio --with-python
     56
     57- :ref:`get a pre-compiled version of libaubio <download>`::
     58
     59    # .deb (linux) WARNING: old version
     60    sudo apt-get install aubio-tools
     61
     62    # python module
     63    ./setup.py install
     64    # using pip
     65    pip install .
     66
     67- :ref:`check the list of optional dependencies <requirements>`::
     68
     69    # debian / ubuntu
     70    dpkg -l libavcodec-dev libavutil-dev libavformat-dev \
     71            libswresample-dev libavresample-dev \
     72            libsamplerate-dev libsndfile-dev \
     73            txt2man doxygen
     74
     75.. include:: download.rst
     76
     77.. include:: building.rst
     78
     79.. include:: requirements.rst
  • doc/xcode_frameworks.rst

    r1136442 r911b175d  
    1 .. _xcode-frameworks-label:
    2 
    3 Using aubio frameworks in Xcode
    4 -------------------------------
     1Frameworks for Xcode
     2--------------------
    53
    64`Binary frameworks`_ are available and ready to use in your XCode project, for
     
    3634
    3735Using aubio from swift
    38 ......................
     36----------------------
     37
     38Once you have downloaded and installed :ref:`aubio.framework
     39<xcode-frameworks-label>`, you sould be able to use aubio from C, Obj-C, and
     40Swift source files.
     41
    3942
    4043Here is a short example showing how to read a sound file in swift:
     
    6871.. _iOS: https://aubio.org/download#ios
    6972.. _macOS: https://aubio.org/download#osx
    70 .. _Download: https://aubio.org/download
  • python/lib/aubio/cut.py

    • Property mode changed from 100755 to 100644
    r1136442 r911b175d  
    77import sys
    88
    9 usage = "usage: %s [options] -i soundfile" % sys.argv[0]
    10 usage += "\n help: %s -h" % sys.argv[0]
    11 
    129def parse_args():
    1310    from optparse import OptionParser
     11    usage = "usage: %s [options] -i soundfile" % sys.argv[0]
     12    usage += "\n help: %s -h" % sys.argv[0]
    1413    parser = OptionParser(usage=usage)
    1514    parser.add_option("-i", "--input", action = "store", dest = "source_file",
     
    134133    (options, args) = parser.parse_args()
    135134    if not options.source_file:
    136         import os.path
    137135        if len(args) == 1:
    138136            options.source_file = args[0]
     
    142140    return options, args
    143141
    144 if __name__ == '__main__':
     142def main():
    145143    options, args = parse_args()
    146144
     
    150148    source_file = options.source_file
    151149
    152     from aubio import onset, tempo, source, sink
     150    from aubio import onset, tempo, source
    153151
    154152    s = source(source_file, samplerate, hopsize)
  • python/lib/moresetuptools.py

    r1136442 r911b175d  
    55from .gen_external import generate_external, header, output_path
    66
    7 def get_aubio_version():
    8     # read from VERSION
    9     this_file_dir = os.path.dirname(os.path.abspath(__file__))
    10     version_file = os.path.join(this_file_dir, '..', '..', 'VERSION')
    11 
    12     if not os.path.isfile(version_file):
    13         raise SystemError("VERSION file not found.")
    14 
    15     for l in open(version_file).readlines():
    16         #exec (l.strip())
    17         if l.startswith('AUBIO_MAJOR_VERSION'):
    18             AUBIO_MAJOR_VERSION = int(l.split('=')[1])
    19         if l.startswith('AUBIO_MINOR_VERSION'):
    20             AUBIO_MINOR_VERSION = int(l.split('=')[1])
    21         if l.startswith('AUBIO_PATCH_VERSION'):
    22             AUBIO_PATCH_VERSION = int(l.split('=')[1])
    23         if l.startswith('AUBIO_VERSION_STATUS'):
    24             AUBIO_VERSION_STATUS = l.split('=')[1].strip()[1:-1]
    25 
    26     if AUBIO_MAJOR_VERSION is None or AUBIO_MINOR_VERSION is None \
    27             or AUBIO_PATCH_VERSION is None:
    28         raise SystemError("Failed parsing VERSION file.")
    29 
    30     verstr = '.'.join(map(str, [AUBIO_MAJOR_VERSION,
    31                                      AUBIO_MINOR_VERSION,
    32                                      AUBIO_PATCH_VERSION]))
    33 
    34     if AUBIO_VERSION_STATUS is not None:
    35         verstr += AUBIO_VERSION_STATUS
    36     return verstr
    37 
    38 def get_aubio_pyversion():
    39     # convert to version for python according to pep 440
    40     # see https://www.python.org/dev/peps/pep-0440/
    41     verstr = get_aubio_version()
    42     if '~alpha' in verstr:
    43         verstr = verstr.split('~')[0] + 'a1'
    44     # TODO: add rc, .dev, and .post suffixes, add numbering
    45     return verstr
     7from this_version import get_aubio_version
    468
    479# inspired from https://gist.github.com/abergmeier/9488990
     
    9456    ext.libraries += ['aubio']
    9557
    96 def add_local_aubio_sources(ext, usedouble = False):
     58def add_local_aubio_sources(ext):
    9759    """ build aubio inside python module instead of linking against libaubio """
    9860    print("Info: libaubio was not installed or built locally with waf, adding src/")
     
    10264
    10365def add_local_macros(ext, usedouble = False):
     66    if usedouble:
     67        ext.define_macros += [('HAVE_AUBIO_DOUBLE', 1)]
    10468    # define macros (waf puts them in build/src/config.h)
    10569    for define_macro in ['HAVE_STDLIB_H', 'HAVE_STDIO_H',
     
    194158    def build_extension(self, extension):
    195159        if self.enable_double or 'HAVE_AUBIO_DOUBLE' in os.environ:
    196             extension.define_macros += [('HAVE_AUBIO_DOUBLE', 1)]
    197160            enable_double = True
    198161        else:
     
    205168            if os.path.isfile(os.path.join('src', 'aubio.h')):
    206169                add_local_aubio_header(extension)
    207             add_local_macros(extension)
     170            add_local_macros(extension, usedouble=enable_double)
    208171            # look for a local waf build
    209172            if os.path.isfile(os.path.join('build','src', 'fvec.c.1.o')):
     
    213176                add_external_deps(extension, usedouble=enable_double)
    214177                # add libaubio sources and look for optional deps with pkg-config
    215                 add_local_aubio_sources(extension, usedouble=enable_double)
     178                add_local_aubio_sources(extension)
    216179        # generate files python/gen/*.c, python/gen/aubio-generated.h
     180        extension.include_dirs += [ output_path ]
    217181        extension.sources += generate_external(header, output_path, overwrite = False,
    218182                usedouble=enable_double)
  • python/tests/test_sink.py

    r1136442 r911b175d  
    118118
    119119    def test_read_with(self):
    120         sink_path =get_tmp_sink_path()
     120        samplerate = 44100
     121        sink_path = get_tmp_sink_path()
    121122        vec = fvec(128)
    122123        with sink(sink_path, samplerate) as g:
    123             for i in range(10):
     124            for _ in range(10):
    124125                g(vec, 128)
    125126
  • python/tests/test_source.py

    r1136442 r911b175d  
    66from aubio import source
    77from .utils import list_all_sounds
    8 import numpy as np
    98
    109import warnings
  • setup.py

    r1136442 r911b175d  
    33import sys, os.path, glob
    44from setuptools import setup, Extension
    5 from python.lib.moresetuptools import *
     5from python.lib.moresetuptools import build_ext, CleanGenerated
    66# function to generate gen/*.{c,h}
    7 from python.lib.gen_external import generate_external, header, output_path
     7from this_version import get_aubio_version, get_aubio_pyversion
    88
    99__version__ = get_aubio_pyversion()
     10__aubio_version__ = get_aubio_version()
    1011
    1112include_dirs = []
    1213library_dirs = []
    13 define_macros = [('AUBIO_VERSION', '%s' % __version__)]
     14define_macros = [('AUBIO_VERSION', '%s' % __aubio_version__)]
    1415extra_link_args = []
    1516
    1617include_dirs += [ 'python/ext' ]
    17 include_dirs += [ output_path ] # aubio-generated.h
    1818try:
    1919    import numpy
     
    5858    packages = ['aubio'],
    5959    package_dir = {'aubio':'python/lib/aubio'},
    60     scripts = ['python/scripts/aubiocut'],
    6160    ext_modules = [aubio_extension],
    6261    description = 'a collection of tools for music analysis',
     
    7675        'build_ext': build_ext,
    7776        },
     77    entry_points = {
     78        'console_scripts': [
     79            'aubio = aubio.cmd:main',
     80            'aubiocut = aubio.cut:main',
     81        ],
     82    },
    7883    test_suite = 'nose2.collector.collector',
    7984    extras_require = {
  • src/io/source_avcodec.c

    r1136442 r911b175d  
    357357      av_strerror (err, errorstr, sizeof(errorstr));
    358358      AUBIO_ERR("source_avcodec: could not read frame in %s (%s)\n", s->path, errorstr);
     359      s->eof = 1;
    359360      goto beach;
    360361    }
     
    374375  if (ret < 0) {
    375376    if (ret == AVERROR(EAGAIN)) {
    376       AUBIO_WRN("source_avcodec: output is not available right now - user must try to send new input\n");
     377      //AUBIO_WRN("source_avcodec: output is not available right now - user must try to send new input\n");
     378      goto beach;
    377379    } else if (ret == AVERROR_EOF) {
    378380      AUBIO_WRN("source_avcodec: the decoder has been fully flushed, and there will be no more output frames\n");
     
    564566  s->avr = NULL;
    565567  if (s->avCodecCtx != NULL) {
     568#ifndef HAVE_AUBIO_LIBAVCODEC_DEPRECATED
     569    avcodec_free_context( &s->avCodecCtx );
     570#else
    566571    avcodec_close ( s->avCodecCtx );
     572#endif
    567573  }
    568574  s->avCodecCtx = NULL;
  • wscript

    r1136442 r911b175d  
    1515APPNAME = 'aubio'
    1616
    17 # source VERSION
    18 for l in open('VERSION').readlines(): exec (l.strip())
    19 
    20 VERSION = '.'.join ([str(x) for x in [
    21     AUBIO_MAJOR_VERSION,
    22     AUBIO_MINOR_VERSION,
    23     AUBIO_PATCH_VERSION
    24     ]]) + AUBIO_VERSION_STATUS
    25 
    26 LIB_VERSION = '.'.join ([str(x) for x in [
    27     LIBAUBIO_LT_CUR,
    28     LIBAUBIO_LT_REV,
    29     LIBAUBIO_LT_AGE]])
     17from this_version import *
     18
     19VERSION = get_aubio_version()
     20LIB_VERSION = get_libaubio_version()
    3021
    3122top = '.'
     
    260251        # one of fftwf or fftw3f
    261252        if (ctx.options.enable_fftw3f != False):
    262             ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
    263                     args = '--cflags --libs',
     253            ctx.check_cfg(package = 'fftw3f',
     254                    args = '--cflags --libs fftw3f >= 3.0.0',
    264255                    mandatory = ctx.options.enable_fftw3f)
    265256            if (ctx.options.enable_double == True):
     
    270261            # enable_double
    271262            if (ctx.options.enable_double == True):
    272                 ctx.check_cfg(package = 'fftw3', atleast_version = '3.0.0',
    273                         args = '--cflags --libs', mandatory =
    274                         ctx.options.enable_fftw3)
     263                ctx.check_cfg(package = 'fftw3',
     264                        args = '--cflags --libs fftw3 >= 3.0.0.',
     265                        mandatory = ctx.options.enable_fftw3)
    275266            else:
    276                 ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
    277                         args = '--cflags --libs',
     267                ctx.check_cfg(package = 'fftw3f',
     268                        args = '--cflags --libs fftw3f >= 3.0.0',
    278269                        mandatory = ctx.options.enable_fftw3)
    279270        ctx.define('HAVE_FFTW3', 1)
     
    291282    # check for libsndfile
    292283    if (ctx.options.enable_sndfile != False):
    293         ctx.check_cfg(package = 'sndfile', atleast_version = '1.0.4',
    294                 args = '--cflags --libs',
     284        ctx.check_cfg(package = 'sndfile',
     285                args = '--cflags --libs sndfile >= 1.0.4',
    295286                mandatory = ctx.options.enable_sndfile)
    296287
     
    304295                    color = 'YELLOW')
    305296    if (ctx.options.enable_samplerate != False):
    306         ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15',
    307                 args = '--cflags --libs',
     297        ctx.check_cfg(package = 'samplerate',
     298                args = '--cflags --libs samplerate >= 0.0.15',
    308299                mandatory = ctx.options.enable_samplerate)
    309300
     
    316307    # check for libav
    317308    if (ctx.options.enable_avcodec != False):
    318         ctx.check_cfg(package = 'libavcodec', atleast_version = '54.35.0',
    319                 args = '--cflags --libs', uselib_store = 'AVCODEC',
     309        ctx.check_cfg(package = 'libavcodec',
     310                args = '--cflags --libs libavcodec >= 54.35.0',
     311                uselib_store = 'AVCODEC',
    320312                mandatory = ctx.options.enable_avcodec)
    321         ctx.check_cfg(package = 'libavformat', atleast_version = '52.3.0',
    322                 args = '--cflags --libs', uselib_store = 'AVFORMAT',
     313        ctx.check_cfg(package = 'libavformat',
     314                args = '--cflags --libs libavformat >= 52.3.0',
     315                uselib_store = 'AVFORMAT',
    323316                mandatory = ctx.options.enable_avcodec)
    324         ctx.check_cfg(package = 'libavutil', atleast_version = '52.3.0',
    325                 args = '--cflags --libs', uselib_store = 'AVUTIL',
     317        ctx.check_cfg(package = 'libavutil',
     318                args = '--cflags --libs libavutil >= 52.3.0',
     319                uselib_store = 'AVUTIL',
    326320                mandatory = ctx.options.enable_avcodec)
    327         ctx.check_cfg(package = 'libswresample', atleast_version = '2.3.0',
    328                 args = '--cflags --libs', uselib_store = 'SWRESAMPLE',
     321        ctx.check_cfg(package = 'libswresample',
     322                args = '--cflags --libs libswresample >= 2.3.0',
     323                uselib_store = 'SWRESAMPLE',
    329324                mandatory = False)
    330325        if 'HAVE_SWRESAMPLE' not in ctx.env:
    331             ctx.check_cfg(package = 'libavresample', atleast_version = '1.0.1',
    332                     args = '--cflags --libs', uselib_store = 'AVRESAMPLE',
     326            ctx.check_cfg(package = 'libavresample',
     327                    args = '--cflags --libs libavresample >= 1.0.1',
     328                    uselib_store = 'AVRESAMPLE',
    333329                    mandatory = False)
    334330
Note: See TracChangeset for help on using the changeset viewer.