Thanks for the WavePlayer code. It appears some wav files will work and some don't? I'm not sure why.
The included clint16.wav and baddonut.wav files work with the most recent WavePlayer program (from http://mbed.org/projects/cookbook/wiki/WavePlayer), but so far I haven't managed to find any others that do. I've tried a variety of sample rates and resolutions, but can still only get the included audio files to work. For example I couldn't get it to work with any of the example files I tried from wikipedia (http://en.wikipedia.org/wiki/WAV). I'm just wondering if I'm missing something obvious?
Basically, with any other wav files, the fopen command is not successful and returns NULL, given the unable to open error...
wavfile=fopen(wavname,"rb");
if (!wavfile) {
printf("Unable to open wav file '%s'\n",wavname);
exit(1);
}
My SD card is working fine and all I am doing is changing the file name to that of another wav file on the same SD card, so I'm uncertain why the fopen command works for some .wav files and not for others, any ideas? I think this might be a wav file structure issue rather than an mbed issue to be fair.
robt
So I imported WavePlayer into my compiler... click compile and I am getting a bunch off errors. I am new to mbed and maybe I am missing something. Anybody tried this program before? I searched but this forum is a real mess.