In this waveplayer, the wave file will be keep looping after the waiting time. For the wave file, my format is 11khz 8bit mono. You might need to have a op-amp across the mbed and speaker as the signal will be very small

Dependencies:   mbed wave_player

Files at this revision

API Documentation at this revision

Comitter:
daryl2110
Date:
Tue Nov 22 08:12:12 2011 +0000
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
wave_player.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r e0d156143789 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Nov 22 08:12:12 2011 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+#include "wave_player.h"
+
+LocalFileSystem local("loc");
+AnalogOut       DACout(p18);
+wave_player     waver(&DACout);
+
+int main() {
+    FILE  *fp = fopen("/loc/Hello.wav", "r");
+    while (1)
+    {
+      waver.play(fp);
+      fseek(fp, 0, SEEK_SET);  // set file poiter to beginning
+      wait(3.0);
+      printf("File Playing\n");
+    }
+    fclose(fp);
+} 
\ No newline at end of file
diff -r 000000000000 -r e0d156143789 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Nov 22 08:12:12 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912
diff -r 000000000000 -r e0d156143789 wave_player.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wave_player.lib	Tue Nov 22 08:12:12 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/sravet/code/wave_player/#acc3e18e77ad