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
main.cpp
- Committer:
- p07gbar
- Date:
- 2012-09-25
- Revision:
- 4:0e55cf186330
- Parent:
- 3:e03854cb5cef
File content as of revision 4:0e55cf186330:
// This is all set up for the AudioCODEC board on the AnimatronicLAB board (RS Product Code 754-1965): Just plug a memory stick
// with a wav file called test.wav on it (such as the one you can get from: https://mbed.org/media/uploads/p07gbar/test.wav)
// and have a listen! Any 16bit PCM Wav files with channel*sample rate less than 48kHz should work.
#include "mbed.h"
#include "WavPlayer.h"
#include "MSCFileSystem.h"
MSCFileSystem msc("msc"); // Mount flash drive under the name "msc"
WavPlayer player;
int main() {
FILE *fp = fopen("/msc/test.wav", "r"); // Open "out.txt" on the local file system for writing
player.open(&fp);
player.play();
fclose(fp);
}
