Speaker
Dependencies: SDFileSystem mbed wave_player
Revision 0:2ac76bf841ff, committed 2015-10-01
- Comitter:
- ldeng31
- Date:
- Thu Oct 01 19:26:43 2015 +0000
- Commit message:
- Speaker
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SDFileSystem.lib Thu Oct 01 19:26:43 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/mbed_official/code/SDFileSystem/#7b35d1709458
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 01 19:26:43 2015 +0000 @@ -0,0 +1,22 @@ +#include "mbed.h" +#include "SDFileSystem.h" +#include "wave_player.h" + +SDFileSystem sd(p5, p6, p7, p8,p9, "sd"); //SD card + +// speaker sound effect demo using PWM hardware output +AnalogOut DACout(p18); + +wave_player waver(&DACout); +//vector<string> filenames; //filenames are stored in a vector string + bool PLAY = true; + bool *PlayStopPtr = &PLAY; + +int main() +{ + FILE *wave_file; + wave_file=fopen("/sd/mySiFiTheme/The Imperial March.wav","r"); + waver.play(wave_file,PlayStopPtr); + fclose(wave_file); + +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 01 19:26:43 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/ba1f97679dad \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wave_player.lib Thu Oct 01 19:26:43 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/zchen311/code/wave_player/#353c78110e44