VS1053 Library Program Demonstration

This program use the VS1053 library to play a MP3 file. The codec is loaded with a path file or a plug-in. There are many function exposed to set volume and bass-boost.

How to use the library

VS1053Codec codec( p11, p12, p13, p21, p22, p23, p24);

int main( void)
{
  codec.init();                      // initialize the codec
  codec.loadpatch();                 // load the patch code (rev 1.5)
  codec.setbassboost( 15, 150);      // set the bass boost value
  codec.settrebleboost( 7, 15000);   // set the treable boost value
  codec.setvolume( 0x0, 0x0);        // set the volume

  // snd_piano is a Ogg file stored in flash memory. 
  int cnt=sizeof(snd_piano)/sizeof(snd_piano[0]);
  //
  printf("Start playing file snd_piano [%d]\n\r", cnt);
  //
  int iSize=0;
  while( iSize < cnt) {
      int count=32;
      codec.testdreq();
      while( count--) {
          codec.writedata( snd_piano[ iSize++]);
          if ( iSize > cnt)
              break;
      }
  }
}

The program demonstration

Import programVS1053_tst

VS1053 Library Program demonstration

The schema

/media/uploads/clemente/vs1053_schema.png

The board I used

VS1053 Board:
http://www.sparkfun.com/products/9943
http://www.watterott.com/index.php?page=product&info=752
SDCard holder:
http://www.mirifica.it/store/51-trioflex-microsd-adapter.html
Graphics LCD
http://www.watterott.com/de/MI0283QT-2-Adapter


Report

4 comments on VS1053 Library Program Demonstration:

10 Oct 2012

Hi,

Even I am trying to play a mp3 file, but I guess I am going wrong in the circuit connection. Can you please let me know what connections have you made for the audio jack.

10 Oct 2012

Hello Pranav, you must use the LEFT and RIGHT signal and as ground the GBUF signal. As you can see from my schema that use the sparkfun breakout board [1].

Please if you are using the sparkfun breakout board [1] double check if it's the new board with the connection of the TEST pin to IOVDD. From the site: "This new revision uses a new board layout and the TEST pin has also been tied in to IOVDD, no more green wires".

Without this modification the use of the board will be problematic/unusable... :-(

Clemente.

[1] https://www.sparkfun.com/products/9943

Pranav Sawant wrote:

Hi,

Even I am trying to play a mp3 file, but I guess I am going wrong in the circuit connection. Can you please let me know what connections have you made for the audio jack.

10 Oct 2012

Hey ,

Many thanks for the reply. I am using the older version of VS 1053 along with "https://www.sparkfun.com/products/10588" audio jack. The connections that I have made are as follows:

GBUF .... Gnd

Left .... TSH

Right.... RSH

Also, if you have the new VS1053 board, can u send across an image of the same as I want to see where exactly are the new changes implemented. Many thanks again for the reply.

Regards, Pranav

10 Oct 2012

I'm sorry, but I have the board without the change. But you can look here: http://www.vsdsp-forum.com/phpbb/viewtopic.php?f=10&t=71

Clemente.

Pranav Sawant wrote:

Hey ,

Many thanks for the reply. I am using the older version of VS 1053 along with "https://www.sparkfun.com/products/10588" audio jack. The connections that I have made are as follows:

GBUF .... Gnd

Left .... TSH

Right.... RSH

Also, if you have the new VS1053 board, can u send across an image of the same as I want to see where exactly are the new changes implemented. Many thanks again for the reply.

Regards, Pranav

Please login to post comments.