source: doc/develop.rst @ f651625

sampler
Last change on this file since f651625 was 2d00e5c, checked in by Paul Brossier <piem@piem.org>, 8 years ago

doc/develop.rst: fix typo

  • Property mode set to 100644
File size: 2.3 KB
RevLine 
[e65fbec]1.. _develop:
2
[7a8a07e]3Developping with aubio
4======================
5
6Read `Contribute`_ to report issues and request new features.
7
8See `Doxygen documentation`_ for the complete documentation of the C library,
9built using `Doxygen <http://www.doxygen.org/>`_.
10
11Below is a brief `Library overview`_.
12
13Library overview
14----------------
15
16Here is a brief overview of the C library. See also the `Doxygen
17documentation`_ for a more detailed list of available functions.
18
19Vectors 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
28
29.. code-block:: C
30
31        // set some elements
32        vec->data[511] = 2.;
33        vec->data[vec->length-2] = 1.;
34
35Similarly, ``fmat_t`` are used to hold matrix of floats.
36
37.. literalinclude:: ../tests/src/test-fmat.c
38   :language: C
39   :lines: 9-19
40
41Reading a sound file
42````````````````````
43In this example, ``aubio_source`` is used to read a media file.
44
45First, create the objects we need.
46
47.. literalinclude:: ../tests/src/io/test-source.c
48   :language: C
49   :lines: 22-24, 30-32, 34
50
51.. note::
52   With ``samplerate = 0``, ``aubio_source`` will be created with the file's
53   original samplerate.
54
55Now for the processing loop:
56
57.. literalinclude:: ../tests/src/io/test-source.c
58   :language: C
59   :lines: 40-44
60
61At the end of the processing loop, clean-up and de-allocate memory:
62
63.. literalinclude:: ../tests/src/io/test-source.c
64   :language: C
65   :lines: 50-56
66
67See the complete example: :download:`test-source.c
68<../tests/src/io/test-source.c>`.
69
70Computing the spectrum
71``````````````````````
72
73Now let's create a phase vocoder:
74
75.. literalinclude:: ../tests/src/spectral/test-phasevoc.c
76   :language: C
77   :lines: 6-11
78
[2d00e5c]79The processing loop could now look like:
[7a8a07e]80
81.. literalinclude:: ../tests/src/spectral/test-phasevoc.c
82   :language: C
83   :lines: 21-35
84
85See the complete example: :download:`test-phasevoc.c
86<../tests/src/spectral/test-phasevoc.c>`.
87
88.. _doxygen-documentation:
89
90Doxygen documentation
91---------------------
92
93The latest version of the doxygen documentation is available at:
94
95    https://aubio.org/doc/latest
96
97Contribute
98----------
99
100Please report any issue and feature request at the `Github issue tracker
101<https://github.com/aubio/aubio/issues>`_. Patches and pull-requests welcome!
102
Note: See TracBrowser for help on using the repository browser.