MP3 Wont play

Ok so after a month of working on this I am so close it's painful. I have hooked up the arduino (Elegoo in fact) Uno to an old rotary phone. The micro SD card attached is supposed to play the audio file through the phone which it doesn't.

I have ran prints to make sure it can actually find the file on the card, and that the card is initialising which it is. However, when the file plays, all I get is static.

I am using the TRMpcm library, but just cant get it to play the file (or it is playing but is just inaudible)

I have checked the phone is actually working OK and it is.

Does anyone have any experience with MicroSD cards and playing audio that could help?

FULL CODE attached

THE VIDEO OF THE PROJECT LIKE THIS ONE:

Code where it plays...

// This number plays a recorded message
Serial.println("before if check");
if(strcmp(number, "5213023") == 0){
#ifdef DEBUG
Serial.println (F("Playing Solved Sound"));
#endif
// Now, we set the pin as OUTPUT for the audio signal
pinMode(phonePin, OUTPUT);
Serial.println("PHONE PIN SET TO OUTPUT CHECK");
// Set the TMRPCM library to use the pin for the output
tmrpcm.speakerPin = 9; // Must be 5, 6, 11 or 46 on MEGA, 9 on UNO, NANO etc
Serial.println("SPEAKER PIN 9");
// Play the appropriate sound file
tmrpcm.play("mp3.mp3");
Serial.println("PLAY MUSIC");
// Wait until the reciever is replaced on the handset
// while(!digitalRead(hookPin)){
pinMode(hookPin, INPUT); {
Serial.println("HOOK PIN SET TO INPUT");
delay(10);
Serial.println("DELAY CHECK"); }

}
// If an incorrect number was dialled
else {
Serial.println("BEFORE ELSE CHECK");
Serial.println("Playing Incorrect Number Sound");
// Set the pin as OUTPUT
pinMode(phonePin, OUTPUT);
Serial.println("PHONE PIN SET TO OUTPUT CHECK");
// Set the TMRPCM library to use the pin for output
tmrpcm.speakerPin = 9; // Must be 5, 6, 11 or 46 on MEGA, 9 on UNO, NANO etc
Serial.println("SPEAKER PIN 9");
// Play the appropriate sound file
tmrpcm.play("wrongnumbermonowav");
Serial.println("PLAY WRONG NUMBER MUSIC");
//state = OFF_HOOK;
// Wait until the reciever is replaced on the handset
// while(!digitalRead(hookPin)){
pinMode(hookPin, INPUT); {
Serial.println("HOOK PIN SET TO INPUT");
// Now wait for the audio to play
delay(1500);
Serial.println("DELAY CHECK");

FULL CODE attached

CODE4.txt (8.57 KB)

If you are trying to play mp3 files - convert them to wav first. The TMRpcm library only supports: " WAV files, 8-bit, 8-32khz Sample Rate, mono."

Otherwise, try the following:

Connect a cheap pair of headphones to the audio output pin and GND. Do you still get only static noise? Then the TRMpcm library does not decode the file format correctly, or you are using the wrong pin(s).

If you just play a tone (example code below) instead of using the TRMpcm library, how does it sound in your phone? If it is only static noise, the problem is in the electric interface to the phone. Research schematics or documentation for it.

//connect speaker to pin 9
void loop() {
   tone(9,440, 1000); //beep for 1 second 
   delay(1000);
}

If you still have problems, please post a photo of your project and the entire code in proper code formatting (see help section).