A simple example of WAV playback for the RS AudioCODEC board. Uses a USB drive to stream music.

Dependencies:   FatFileSystem MSCFileSystem WavPlayer mbed

Fork of WavPlayer_test by Giles Barton-Owen

Committer:
p07gbar
Date:
Wed Sep 19 11:03:56 2012 +0000
Revision:
0:d49f4c0f2ba7
Child:
2:8818d976f1e7
Working

Who changed what in which revision?

UserRevisionLine numberNew 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 }