- Timestamp:
- Aug 27, 2016, 12:39:56 AM (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:
- a96413e
- Parents:
- 2f965e2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/python_module.rst
r2f965e2 rd44763f 1 .. _python: 2 1 3 Python module 2 4 ============= 3 5 6 The aubio extension for Python is available for Python 2.7 and Python 3. 7 4 8 Installing aubio with pip 5 9 ------------------------- 10 11 aubio can now be installed using ``pip`` and ``easy_install``. 6 12 7 13 .. code-block:: bash … … 26 32 "import aubio"``. 27 33 28 A verysimple example29 ................ .....34 A simple example 35 ................ 30 36 31 Here is a very simple script32 t o readall the samples from a media file:37 Here is a :download:`simple script <../python/demos/demo_source_simple.py>` 38 that reads all the samples from a media file: 33 39 34 .. code-block:: python 35 36 #! /usr/bin/env python 37 import aubio 38 39 s = aubio.source(sys.argv[1], 0, 256) 40 while True: 41 samples, read = s() 42 #print(samples) 43 if read < 256: break 40 .. literalinclude:: ../python/demos/demo_source_simple.py 41 :language: python 44 42 45 43 Filtering an input sound file 46 44 ............................. 47 45 48 Here is a more complete example, `demo_filter.py`_. This files executes the following: 46 Here is a more complete example, :download:`demo_filter.py 47 <../python/demos/demo_filter.py>`. This files executes the following: 49 48 50 49 * read an input media file (``aubio.source``) 51 50 52 * filter it using an A-weighting filter (``aubio.digital_filter``) 51 * filter it using an `A-weighting <https://en.wikipedia.org/wiki/A-weighting>`_ 52 filter (``aubio.digital_filter``) 53 53 54 54 * write result to a new file (``aubio.sink``) … … 68 68 ``python/tests/run_all_tests``. 69 69 70 .. _python tests folder: https://github.com/aubio/aubio/blob/master/python/tests71 70 .. _python demos folder: https://github.com/aubio/aubio/blob/master/python/demos 72 71 .. _demo_filter.py: https://github.com/aubio/aubio/blob/master/python/demos/demo_filter.py 72 .. _python tests: https://github.com/aubio/aubio/blob/master/python/tests 73 73
Note: See TracChangeset
for help on using the changeset viewer.