A test program for the WavPlayer class, works on the RS Animatronic Lab Board
Dependencies: FatFileSystem MSCFileSystem WavPlayer mbed
main.cpp@0:d49f4c0f2ba7, 2012-09-19 (annotated)
- Committer:
- p07gbar
- Date:
- Wed Sep 19 11:03:56 2012 +0000
- Revision:
- 0:d49f4c0f2ba7
- Child:
- 2:8818d976f1e7
Working
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
p07gbar | 0:d49f4c0f2ba7 | 1 | // This is all set up for the RS Labboard: Just plug a memory stick with a wav file called test.wav on it and have a listen! |
p07gbar | 0:d49f4c0f2ba7 | 2 | |
p07gbar | 0:d49f4c0f2ba7 | 3 | #include "mbed.h" |
p07gbar | 0:d49f4c0f2ba7 | 4 | #include "WavPlayer.h" |
p07gbar | 0:d49f4c0f2ba7 | 5 | #include "MSCFileSystem.h" |
p07gbar | 0:d49f4c0f2ba7 | 6 | |
p07gbar | 0:d49f4c0f2ba7 | 7 | MSCFileSystem msc("msc"); // Mount flash drive under the name "msc" |
p07gbar | 0:d49f4c0f2ba7 | 8 | WavPlayer player; |
p07gbar | 0:d49f4c0f2ba7 | 9 | |
p07gbar | 0:d49f4c0f2ba7 | 10 | int main() { |
p07gbar | 0:d49f4c0f2ba7 | 11 | FILE *fp = fopen("/msc/test.wav", "r"); // Open "out.txt" on the local file system for writing |
p07gbar | 0:d49f4c0f2ba7 | 12 | player.open(&fp); |
p07gbar | 0:d49f4c0f2ba7 | 13 | player.play(); |
p07gbar | 0:d49f4c0f2ba7 | 14 | fclose(fp); |
p07gbar | 0:d49f4c0f2ba7 | 15 | } |