source: doc/develop.rst @ bf1c0e43

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since bf1c0e43 was 7a8a07e, checked in by Paul Brossier <piem@piem.org>, 8 years ago

doc/develop.rst: add some documentation about the c-api

  • Property mode set to 100644
File size: 2.3 KB

Developping with aubio

Read Contribute to report issues and request new features.

See Doxygen documentation for the complete documentation of the C library, built using Doxygen.

Below is a brief Library overview.

Library overview

Here is a brief overview of the C library. See also the Doxygen documentation for a more detailed list of available functions.

Vectors and matrix

fvec_t are used to hold vectors of float (smpl_t).

?
.. literalinclude:: ../tests/src/test-fvec.c
   :language: C
   :lines: 7
// set some elements
vec->data[511] = 2.;
vec->data[vec->length-2] = 1.;

Similarly, fmat_t are used to hold matrix of floats.

?
.. literalinclude:: ../tests/src/test-fmat.c
   :language: C
   :lines: 9-19

Reading a sound file

In this example, aubio_source is used to read a media file.

First, create the objects we need.

?
.. literalinclude:: ../tests/src/io/test-source.c
   :language: C
   :lines: 22-24, 30-32, 34

Note

With samplerate = 0, aubio_source will be created with the file's original samplerate.

Now for the processing loop:

?
.. literalinclude:: ../tests/src/io/test-source.c
   :language: C
   :lines: 40-44

At the end of the processing loop, clean-up and de-allocate memory:

?
.. literalinclude:: ../tests/src/io/test-source.c
   :language: C
   :lines: 50-56

See the complete example: :download:`test-source.c <../tests/src/io/test-source.c>`.

?

Computing the spectrum

Now let's create a phase vocoder:

?
.. literalinclude:: ../tests/src/spectral/test-phasevoc.c
   :language: C
   :lines: 6-11

The processing loop could know look like:

?
.. literalinclude:: ../tests/src/spectral/test-phasevoc.c
   :language: C
   :lines: 21-35

See the complete example: :download:`test-phasevoc.c <../tests/src/spectral/test-phasevoc.c>`.

?

Doxygen documentation

The latest version of the doxygen documentation is available at:

https://aubio.org/doc/latest

Contribute

Please report any issue and feature request at the Github issue tracker. Patches and pull-requests welcome!

Note: See TracBrowser for help on using the repository browser.