Unable to play wav file through Wave_player

17 Nov 2011

Hello guys,

I am encountering a problem here,I had imported the program wave_player to my compiler but when I send to mbed trying to play the wav file,I couldn't play the audio, can anyone help me?

This is my programming

  1. include "mbed.h"
  1. include "wave_player.h"

AnalogOut DACout(p18);

wave_player waver(&DACout);

int main() { FILE *wave_file;

printf("\n\n\nHello, wave world!\n");

wave_file=fopen("/local/Hello.wav","r");

waver.play(wave_file);

fclose(wave_file);

}

And this is my connection, just for your info, i connect to p18

/media/uploads/daryl2110/13114840.gif

Hope you guys can help me

18 Nov 2011

I tried include LocalFileSystem local("local"); to my program, it still doesn't work.

I tried to debug the program and i notice that the program stop at waver.play(wave_file); and it doesn't continue. I not too sure isit something wrong with it?

18 Nov 2011

Oh I see, can i see ur connection for the mbed to speaker? anyway what is the format for wave file? my format is 22khz 16bit mono, just wondering could it be that my format of the file is wrong?

22 Nov 2011

hey thanks a lot! i had solve it! ya i need an amplifier to amplify the signal, if not it will be too soft

22 Nov 2011

oh I see, Yah I had rewrote my program and it work perfectly well, although the quality of the audio is not that good, but it can be heard. Tomorrow I will try using an SD card, hope that it will work well! anyway really thank you for ur help! appreciate a lot (:

22 Nov 2011

oh I see, Yah I had rewrote my program and it work perfectly well, although the quality of the audio is not that good, but it can be heard. Tomorrow I will try using an SD card, hope that it will work well! anyway really thank you for ur help! appreciate a lot (: