sound file with SD card

hey guys,
I find this code

#include "SD.h"
#define SD_ChipSelectPin 10
#include "TMRpcm.h"
#include "SPI.h"

TMRpcm tmrpcm;

void setup()
{
tmrpcm.speakerPin=9;
Serial.begin(9600);
if(!SD.begin(SD_ChipSelectPin))
{
  Serial.println("SD fail");
  return;
}
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");

}

void loop() {
  // put your main code here, to run repeatedly:

}

it's work perfect except two things the sound file must be wav file, and cant be mp3 file. why?

and the second thing I want to ask is how How to reduce static noise

thank in advance

it's work perfect except two things the sound file must be wav file

A WAV file is the "simplest" audio file format. It's just [u]sequence of sample values[/u]. When you "connect the dots", you get-back an analog waveform. And, it has a [u]WAV file header[/u] with the sample rate, the number of channels, and the bit-depth telling the software how to re-construct the samples from the bytes and play the audio correctly. (A "raw" PCM file is simpler, but without the header the software has to know the format details in advance.)

and cant be mp3 file. why?

MP3 is compressed and has to be decompressed/decoded. It's very similar to encryption... If you try to play an MP3 without decompressing it, it just sounds like pure-noise, and of course the playing time is a lot shorter because the file is smaller.

The TMRpcm library doesn't include an MP3 decoder, and from what I understand the Arduino isn't fast enough for real-time MP3 decoding.

and the second thing I want to ask is how How to reduce static noise

I've never used the TMRpcm library, so maybe someone else can help you with that one. ...I wouldn't expect great quality without a DAC, but some people have said the quality is OK and I just don't know.

DVDdoug:
A WAV file is the "simplest" audio file format. It's just [u]sequence of sample values[/u]. When you "connect the dots", you get-back an analog waveform. And, it has a [u]WAV file header[/u] with the sample rate, the number of channels, and the bit-depth telling the software how to re-construct the samples from the bytes and play the audio correctly. (A "raw" PCM file is simpler, but without the header the software has to know the format details in advance.)
MP3 is compressed and has to be decompressed/decoded. It's very similar to encryption... If you try to play an MP3 without decompressing it, it just sounds like pure-noise, and of course the playing time is a lot shorter because the file is smaller.

The TMRpcm library doesn't include an MP3 decoder, and from what I understand the Arduino isn't fast enough for real-time MP3 decoding.
I've never used the TMRpcm library, so maybe someone else can help you with that one. ...I wouldn't expect great quality without a DAC, but some people have said the quality is OK and I just don't know.

At first I used a sound component (isd4004) but the software was complicated and difficult to understand and there were not so many guides on it
I originally planned to do a recording and the component will play it but as I said it was complicated so I preferred to use a memory card

So now i have a question
Can you recommend something else or maybe another code to which component will play the recording (if possible then it is better for an existing recording or song)?

Can you recommend something else

Given your lack of experance and coding knowledge then I would explore the options given to you with this product:- Overview | Adafruit Music Maker Shield | Adafruit Learning System