Changeset 088760e for doc/python_module.rst
- Timestamp:
- Oct 31, 2018, 10:26:52 PM (5 years ago)
- Branches:
- feature/constantq
- Children:
- c03d191
- Parents:
- 45c2c5c (diff), 7a54b37 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/python_module.rst
r45c2c5c r088760e 1 .. _python :1 .. _python-install: 2 2 3 Python module 4 ============= 3 Installing aubio for Python 4 =========================== 5 5 6 6 The aubio extension for Python is available for Python 2.7 and Python 3. … … 11 11 aubio can now be installed using ``pip``: 12 12 13 .. code-block:: bash13 .. code-block:: console 14 14 15 15 $ pip install aubio … … 20 20 From ``aubio`` source directory, run the following: 21 21 22 .. code-block:: bash22 .. code-block:: console 23 23 24 24 $ ./setup.py clean … … 26 26 $ sudo ./setup.py install 27 27 28 Using aubio in python29 ---------------------30 28 31 Once you have python-aubio installed, you should be able to run ``python -c 32 "import aubio; print(aubio.version)"``. 29 .. _py-doubleprecision: 33 30 34 A simple example 35 ................ 31 Double precision 32 ---------------- 36 33 37 Here is a :download:`simple script <../python/demos/demo_source_simple.py>` 38 that reads all the samples from a media file: 34 This module can be compiled in double-precision mode, in which case the 35 default type for floating-point samples will be 64-bit. The default is 36 single precision mode (32-bit, recommended). 39 37 40 .. literalinclude:: ../python/demos/demo_source_simple.py 41 :language: python 38 To build the aubio module with double precision, use the option 39 `--enable-double` of the `build_ext` subcommand: 42 40 43 Filtering an input sound file 44 ............................. 41 .. code:: bash 45 42 46 Here is a more complete example, :download:`demo_filter.py 47 <../python/demos/demo_filter.py>`. This files executes the following: 43 $ ./setup.py clean 44 $ ./setup.py build_ext --enable-double 45 $ pip install -v . 48 46 49 * read an input media file (``aubio.source``) 47 **Note**: If linking against `libaubio`, make sure the library was also 48 compiled in :ref:`doubleprecision` mode. 50 49 51 * filter it using an `A-weighting <https://en.wikipedia.org/wiki/A-weighting>`_52 filter (``aubio.digital_filter``)53 50 54 * write result to a new file (``aubio.sink``) 51 Checking your installation 52 -------------------------- 55 53 56 .. literalinclude:: ../python/demos/demo_filter.py 57 :language: python 54 Once the python module is installed, its version can be checked with: 58 55 59 More demos 60 .......... 56 .. code-block:: console 61 57 62 Check out the `python demos folder`_ for more examples. 58 $ python -c "import aubio; print(aubio.version, aubio.float_type)" 59 60 The command line `aubio` is also installed: 61 62 .. code-block:: console 63 64 $ aubio -h 65 63 66 64 67 Python tests … … 68 71 ``python/tests/run_all_tests``. 69 72 70 .. _python demos folder: https://github.com/aubio/aubio/blob/master/python/demos71 73 .. _demo_filter.py: https://github.com/aubio/aubio/blob/master/python/demos/demo_filter.py 72 74 .. _python tests: https://github.com/aubio/aubio/blob/master/python/tests 73
Note: See TracChangeset
for help on using the changeset viewer.