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: main.cpp
- Revision:
- 2:9429f84ea165
- Parent:
- 0:bbf6cf0eab95
--- a/main.cpp Thu Mar 27 21:30:20 2014 +0000 +++ b/main.cpp Thu Mar 27 21:43:41 2014 +0000 @@ -69,19 +69,23 @@ int main() { - UI_Initialize(); - Audio_Initialize(); // Start audio playback. + UI_Initialize(); // Init the user interface. + Audio_Initialize(); // Starts audio playback. while (true) { - // + // Check the playback buffer level. int32_t level = Audio_CheckPlaybackBufferLevel(); + + // Update the user interface, passing in the current buffer level + // for display UI_Update(level); - Effects_SetGain(UI_GetEffectGain()); + // Set the effect mode and gain according to the user input. Effects_SetMode(UI_GetEffectMode()); + Effects_SetGain(UI_GetEffectGain()); - // 50 milliseconds provides good UI responsivness + // 50 milliseconds provides good UI responsivness. wait(.05); } }