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. */
Revision 2:9429f84ea165, committed 2014-03-27
- Comitter:
- bw
- Date:
- Thu Mar 27 21:43:41 2014 +0000
- Parent:
- 1:d2250586c044
- Commit message:
- Clean up comments.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r d2250586c044 -r 9429f84ea165 main.cpp --- 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); } }