I have a problem using the right file, the VS1053B chip describs that it can play mp3 files
Decodes formats
Ogg Vorbis
MP3 = MPEG 1 & 2 audio layer III (CBR+VBR+ABR)
MP1 & MP2 = MPEG 1 & 2 audio layers I & II optional
MPEG4 / 2 AAC-LC(+PNS), HE-AAC v2 (Level 3) (SBR + PS)
WMA4.0/4.1/7/8/9 all profiles (5-384 kbps)
FLAC lossless audio with software plugin (upto 24 bits, 48 kHz)
WAV (PCM + IMA ADPCM)
General MIDI 1 / SP-MIDI format 0
I tried mp3, mp2, wav, non of them work correctly + I need to down my bit rate, but doing that
it kills the audio quality, any info on what's the best file format/specs for audio file, cause till now
I get only problems, non of the files are good quality.
I use Audacity to create my audio files.
Code:
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>
#if defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_Timer1
#include <TimerOne.h>
#elif defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer
#include <SimpleTimer.h>
#endif
SdFat sd;
SFEMP3Shield MP3player;
int16_t last_ms_char; // milliseconds of last recieved character from Serial port.
int8_t buffer_pos; // next position to recieve character from Serial port.
char buffer[6]; // 0-35K+null
int x;
void setup() {
x = 0;
uint8_t result;
Serial.begin(115200);
//Initialize the SdCard.
if(!sd.begin(SD_SEL, SPI_FULL_SPEED)) sd.initErrorHalt();
// depending upon your SdCard environment, SPI_HAVE_SPEED may work better.
if(!sd.chdir("/")) sd.errorHalt("sd.chdir");
result = MP3player.begin();
x=1;
/*
MP3player.playTrack(1);
delay(150);
MP3player.stopTrack();
MP3player.playTrack(2);
delay(150);
MP3player.stopTrack();
MP3player.playTrack(3);
delay(150);
MP3player.stopTrack();
MP3player.playTrack(11);
delay(2000);
MP3player.stopTrack();
*/
}
void loop() {
if(!MP3player.isPlaying()) {
MP3player.playTrack(x);
x+=1;
}
//delay(1000);
}