From 5782f99c808079d0530b9314312520c66f88a8f3 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 24 Mar 2017 19:46:40 +0100 Subject: [PATCH] doc/develop.rst: improve examples --- doc/develop.rst | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/develop.rst b/doc/develop.rst index ddf7464e..fc12d75d 100644 --- a/doc/develop.rst +++ b/doc/develop.rst @@ -85,9 +85,10 @@ Basic Types Reading a sound file -------------------- -In this example, ``aubio_source`` is used to read a media file. +In this example, `aubio_source `_ +is used to read a media file: -First, create the objects we need. +First, define a few variables and allocate some memory. .. literalinclude:: ../tests/src/io/test-source.c :language: C @@ -103,11 +104,11 @@ Now for the processing loop: :language: C :lines: 40-44 -At the end of the processing loop, clean-up and de-allocate memory: +At the end of the processing loop, memory is deallocated: .. literalinclude:: ../tests/src/io/test-source.c :language: C - :lines: 50-56 + :lines: 55-56 See the complete example: :download:`test-source.c <../tests/src/io/test-source.c>`. @@ -125,7 +126,13 @@ The processing loop could now look like: .. literalinclude:: ../tests/src/spectral/test-phasevoc.c :language: C - :lines: 21-35 + :lines: 20-37 + +Time to clean up the previously allocated memory: + +.. literalinclude:: ../tests/src/spectral/test-phasevoc.c + :language: C + :lines: 39-44 See the complete example: :download:`test-phasevoc.c <../tests/src/spectral/test-phasevoc.c>`. -- 2.11.0