Playing wav file from SD card on Ethernet shield
hello, trying figure out how wav file play micro sd card on seeed w5200 ethernet shield, using sd , tmrpcm libraries. seemed me should have been able use of example code tmrpcm library, changing file name, , had work. have made sure sd card formatted correctly. converted file mp3 wav using itunes setting sample rate 8.00khz, sample size 8-bit , channel mono, instructed , copied the sd card. have set cs pin 10 output ethernet peripheral , set pin 4 chip select pin sd card. after of still can't file play. thought maybe tmrpcm library because had issue importing it, after figured out , put debugging code (tmrpcm.isplaying()) in tell me in serial monitor whether or not song playing, library seemed working fine. have ideas??
code: [select]
#include <sd.h>
#define sd_chipselectpin 4
#include <tmrpcm.h>
tmrpcm tmrpcm;
void setup()
{
tmrpcm.speakerpin = 9;
pinmode(10, output);
digitalwrite(10, high);
pinmode(9,output); //speaker pin
serial.begin(9600);
if (!sd.begin(sd_chipselectpin))
{
serial.println("sd fail");
return;
}
else
{
sd.begin(sd_chipselectpin);
serial.println("sd ok");
serial.println("playing...");
tmrpcm.play("misbehavin");
int playing = tmrpcm.isplaying();
serial.println(playing);
}
}
void loop()
{}
i never got working tmrpcm library used sdaudio library instead ...
Arduino Forum > Using Arduino > Audio > Playing wav file from SD card on Ethernet shield
arduino
Comments
Post a Comment