Changeset d44763f for doc


Ignore:
Timestamp:
Aug 27, 2016, 12:39:56 AM (8 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, pitchshift, sampler, timestretch, yinfft+
Children:
a96413e
Parents:
2f965e2
Message:

doc/python_module.rst: add demo_source_simple.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/python_module.rst

    r2f965e2 rd44763f  
     1.. _python:
     2
    13Python module
    24=============
    35
     6The aubio extension for Python is available for Python 2.7 and Python 3.
     7
    48Installing aubio with pip
    59-------------------------
     10
     11aubio can now be installed using ``pip`` and ``easy_install``.
    612
    713.. code-block:: bash
     
    2632"import aubio"``.
    2733
    28 A very simple example
    29 .....................
     34A simple example
     35................
    3036
    31 Here is a very simple script
    32 to read all the samples from a media file:
     37Here is a :download:`simple script <../python/demos/demo_source_simple.py>`
     38that reads all the samples from a media file:
    3339
    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
    4442
    4543Filtering an input sound file
    4644.............................
    4745
    48 Here is a more complete example, `demo_filter.py`_. This files executes the following:
     46Here is a more complete example, :download:`demo_filter.py
     47<../python/demos/demo_filter.py>`. This files executes the following:
    4948
    5049* read an input media file (``aubio.source``)
    5150
    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``)
    5353
    5454* write result to a new file (``aubio.sink``)
     
    6868``python/tests/run_all_tests``.
    6969
    70 .. _python tests folder: https://github.com/aubio/aubio/blob/master/python/tests
    7170.. _python demos folder: https://github.com/aubio/aubio/blob/master/python/demos
    7271.. _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
    7373
Note: See TracChangeset for help on using the changeset viewer.