I tried following all the steps, but still having no audio out of the speaker. I run the CardInfo example to check the SD card format, run also the ReadWrite example with no errors (to say the SD card is formatted and configured as it should be -unless I'm missing something), my audio file is 16kHz, mono/8 bits, but to exclude the audio file format issue, I also tested using the same audio file from the post above, I also tested a simple tone code to test the audio/amplifier and the speaker and got audio out loud and clear (all these codes that were tested, were run on the same schematic, all of which worked fine), so far, I think the speaker is ok, the audio file (in the root/top level folder, with a simple 8.3 plain old DOS naming convention: 'AAA.wav', and the SD card formatted FAT32), yet still getting weak buzzing signal at the output each 5sec (because of the added delay in the loop)
I'm using an audio amplifier module using LM386, which also includes a capacitor and at least one resistor.
Hi this is the guy that had that similar problem, obviously grumpy mike helped me through it but if you followed all the steps(my problem was simply adding a delay to the code) it’s probably something to do with the file you did create use a wag converter like this one MP3 to WAV | CloudConvert right? Then you just drag it onto a Micro SD card, put it into the adapter and run the code. Otherwise, just make sure you’re plugging in the adapter correctly
Thanks for the tips. Yes I read the post of yours, and I did try running the code with the file you attached in your post just to eliminate the possibility of a file format issue, I tried also other wav files from other projects, all gave the same result, so, I don't think it the audio file. Also while debugging, I've tested the SD card adapter/connection, running the CardInfo build in example as well as the ReadWrite example, both run and was able to read the text file from the SD card with no issue, verified the file system format, file location, naming, audio encoding (pcm, 16KHz, 8 bits mono) ...etc. Again, the speaker played tone melody example fine too. It's only when trying to play ANY audio file, it doesn't output anything but a hissing sound. The only remaining different is that I used of the audio amplifier which wasn't in your case, and tried following up the wiring in the example here: DIY Arduino Music Player with Audio Amplifier Using LM386 – QuartzComponents, but failed to get it to work. Wonder if I overlooked something somewhere.
Thanks again!
I may be wrong, but I think tmrpcm.speakerPin is limited to pin 9
I know that this sketch works fine --
#include <SD.h> // need to include the SD library
//#define SD_ChipSelectPin 53 //example uses hardware SS pin 53 on Mega2560
#define SD_ChipSelectPin 4 //using digital pin 4 on arduino nano 328, can use other pins
#include <TMRpcm.h> // also need to include this library...
#include <SPI.h>
TMRpcm tmrpcm; // create an object for use in this sketch
void setup()
{
tmrpcm.speakerPin = 9; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
//tmrpcm.soundBuff = 500; //uses 1KB memory. Min setting is about 200 (400 bytes)
Serial.begin(19200);
if (!SD.begin(SD_ChipSelectPin))
{ // see if the card is present and can be initialized:
Serial.println("SD fail");
return; // don't do anything more if not
}
tmrpcm.setVolume(6);
Serial.println("Let's Go");
tmrpcm.play("pipssd.wav"); //the sound file "music" will play each time the arduino powers up, or is reset
}
void loop()
{
if(Serial.available())
{
if(Serial.read() == 'p')
{ //send the letter p over the serial monitor to start playback
Serial.println("ok");
tmrpcm.play("pipssd.wav");
}
}
}
are you sure it shouldn't be .WAV and not .wav? I haven't used this board but have used the Adafruit Wave Shield and remember it being very particular about things like that.
Not sure, but I think that should not be the case, FAT/FAT32 make no distinction of the upper/lowercase in filenames unlike other file systems which do, and I've tried as well to be sure but that made no difference in this case unfortunately.