Strange behaviour with my SD shield and UNO

Hi, so today my hardware is acting really weirdly, even though it was working perfectly fine yesterday. Basically the arduino reads and plays a wav file (TMRpcm lib) from an SD using a common SD card reader shield. My hardware is the LC studio SD shield and UNO. I tried everything I could think of, changed all the wires for new ones (they are in exactly same pins), tried a different SD card, re-formatted both, changed the chip selector pin. What’s weird is it will randomly say SD is present, (however does not play sound), but most of the time it says no SD present. Btw I’m 100% certain the wires aren’t coming loose. I’m starting to think my shield is broken or shorted or something. My code is as:

#include <SD.h>
#define SD_CARD 9  

// This library plays the audio
#include <TMRpcm.h>         

TMRpcm sample;   //object for audio

void setup()

  // set the speaker pin 
  sample.speakerPin = 8; 
  // see if the card is ok
  if (!SD.begin(SD_CARD)) 
	  Serial.println("No SD present.");
	 return;   // It's not there, don't do anything
Serial.println("SD present");
 // play the start up sound"test.wav"); 
void loop()



My hardware is the LC studio SD shield and UNO.

I can’t find documentation for any “LC Studio SD Shield”. Do you mean one of these SD modules?

Since it is an intermittent error it sounds like a hardware problem to me. Check the solder connections and try to find a way to clean the SD contacts.