Mercurial > hg > beaglert
diff 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 |
line wrap: on
line diff
--- a/projects/samples/render.cpp Wed May 11 10:29:23 2016 +0100 +++ b/projects/samples/render.cpp Tue May 17 15:40:16 2016 +0100 @@ -1,10 +1,44 @@ /* - * render.cpp + ____ _____ _ _ +| __ )| ____| | / \ +| _ \| _| | | / _ \ +| |_) | |___| |___ / ___ \ +|____/|_____|_____/_/ \_\.io + + */ + +/* * - * Created on: Oct 24, 2014 - * Author: Andrew McPherson and Victor Zappi + * Andrew McPherson and Victor Zappi + * Queen Mary, University of London */ +/** +\example 4_audio_samples + +Playback WAV files +------------------ + +This sketch shows how to playback audio samples from a buffer. + +An audio file is loaded into a buffer `SampleData` as `gSampleData`. This is +accessed with a read pointer that is incremented at audio rate within the render +function: `out += gSampleData.samples[gReadPtr++]`. + +Note that the read pointer is stopped from incrementing past the length of the +`gSampleData`. This is achieved by comparing the read pointer value against the +sample length which we can access as follows: `gSampleData.sampleLen`. + +The sample is triggered by keyboard input: (a) starts sample playback, (s) +stops sample playback. The triggering is treated as a lower priority task than +the audio. You can see this at the bottom of the render function: +`Bela_scheduleAuxiliaryTask(gTriggerSamplesTask)`; + +Edit + +*/ + + #include <BeagleRT.h> #include <cmath>