This program is to play wave file through sd card

Dependencies:   mbed wave_player SDFileSystem

Files at this revision

API Documentation at this revision

Comitter:
daryl2110
Date:
Thu Nov 24 06:28:15 2011 +0000
Commit message:

Changed in this revision

FATFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
SDFileSystem.lib Show annotated file Show diff for this revision Revisions of this file
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 0ed9e25c735f FATFileSystem.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/FATFileSystem.lib	Thu Nov 24 06:28:15 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_unsupported/code/fatfilesystem/
\ No newline at end of file
diff -r 000000000000 -r 0ed9e25c735f SDFileSystem.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SDFileSystem.lib	Thu Nov 24 06:28:15 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/SDFileSystem/#b1ddfc9a9b25
diff -r 000000000000 -r 0ed9e25c735f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 24 06:28:15 2011 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "wave_player.h"
+#include "SDFileSystem.h"
+
+SDFileSystem sd(p5, p6, p7, p8, "sd");
+AnalogOut       DACout(p18);
+wave_player     waver(&DACout);
+
+int main() {
+
+    mkdir("/sd/wf/", 0777);     // make the directory to the SD card
+                                // 0777 is the default mode so to have the widest access 
+                              
+    FILE  *fp = fopen("/sd/wf/Hello.wav", "r");
+    
+    if(fp == NULL){
+    printf("File couldn't open\n");
+    }
+    
+    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 0ed9e25c735f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 24 06:28:15 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912
diff -r 000000000000 -r 0ed9e25c735f wave_player.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wave_player.lib	Thu Nov 24 06:28:15 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/sravet/code/wave_player/#acc3e18e77ad