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