comparison projects/samples/render.cpp @ 269:ac8eb07afcf5

Oxygen text added to each render.cpp file for the default projects. Text includes project explanation from Wiki, edited in places. Empty project added as a default project. Doxyfile updated. Each of the project locations added to INPUT configuration option. Consider just watching the whole project file so all new projects are automatically pulled through.
author Robert Jack <robert.h.jack@gmail.com>
date Tue, 17 May 2016 15:40:16 +0100
parents 3c3a1357657d
children
comparison
equal deleted inserted replaced
252:381f352c44eb 269:ac8eb07afcf5
1 /* 1 /*
2 * render.cpp 2 ____ _____ _ _
3 | __ )| ____| | / \
4 | _ \| _| | | / _ \
5 | |_) | |___| |___ / ___ \
6 |____/|_____|_____/_/ \_\.io
7
8 */
9
10 /*
3 * 11 *
4 * Created on: Oct 24, 2014 12 * Andrew McPherson and Victor Zappi
5 * Author: Andrew McPherson and Victor Zappi 13 * Queen Mary, University of London
6 */ 14 */
15
16 /**
17 \example 4_audio_samples
18
19 Playback WAV files
20 ------------------
21
22 This sketch shows how to playback audio samples from a buffer.
23
24 An audio file is loaded into a buffer `SampleData` as `gSampleData`. This is
25 accessed with a read pointer that is incremented at audio rate within the render
26 function: `out += gSampleData.samples[gReadPtr++]`.
27
28 Note that the read pointer is stopped from incrementing past the length of the
29 `gSampleData`. This is achieved by comparing the read pointer value against the
30 sample length which we can access as follows: `gSampleData.sampleLen`.
31
32 The sample is triggered by keyboard input: (a) starts sample playback, (s)
33 stops sample playback. The triggering is treated as a lower priority task than
34 the audio. You can see this at the bottom of the render function:
35 `Bela_scheduleAuxiliaryTask(gTriggerSamplesTask)`;
36
37 Edit
38
39 */
40
7 41
8 42
9 #include <BeagleRT.h> 43 #include <BeagleRT.h>
10 #include <cmath> 44 #include <cmath>
11 #include "SampleData.h" 45 #include "SampleData.h"