Streams USB audio with sound effects applied. Sound effect selected by joystick and intensity altered by tilting the mbed. Output to the mbed-application-board phono jack.
Dependencies: C12832_lcd MMA7660 USBDevice mbed
/* Uses the mbed LPC1768 and mbed-application-board to create a USB audio device * that streams audio from a host computer to headphones or powered speakers. * A couple different sound effects can be applied to the stream in real-time, * and tilting the mbed alters intensity of the effect. * * ECHO * The joystick selects ) | * one of three effect ) STRAIGHT - o - STRAIGHT * modes. ) | * REVERB * * * * \\ || * Tilting the mbed ) ====== \\ || * determines intensity ) \\ || * of the effect. ) * 0% 50% 100% * * The LCD display shows the current effect mode, intesity and buffer level. */
Diff: effects.h
- Revision:
- 0:bbf6cf0eab95
diff -r 000000000000 -r bbf6cf0eab95 effects.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/effects.h Thu Mar 27 21:27:04 2014 +0000 @@ -0,0 +1,32 @@ +/******************************************************************************* + * Module processes 16-bit audio samples to produces delay-based sound effects. + * Bryan Wade + * 27 MAR 2014 + ******************************************************************************/ +#ifndef EFFECTS_H +#define EFFECTS_H + +#include <stdint.h> + +// Practical gain limit for decent sound. +#define MAX_EFFECT_GAIN (58982) + +// Available sound effect modes +typedef enum effect_mode_t { + EFFECT_STRAIGHT, + EFFECT_ECHO, + EFFECT_REVERB +} effect_mode_t; + + +// Initialize module. +void Effects_Initialize(void); + +// Process one audio sample. +int16_t Effects_ProcessSample(int16_t dataIn); + +void Effects_SetMode(effect_mode_t mode); + +void Effects_SetGain(uint16_t gain); + +#endif \ No newline at end of file