Giter VIP home page Giter VIP logo

Comments (4)

TheNitek avatar TheNitek commented on July 25, 2024

I implemented it like this: https://github.com/TheNitek/RfidShelf/blob/25d03f8f40259af9c3f79db7839ce8766bed2723/RfidShelf/src/ShelfPlayback.cpp#L329 using the patch from here: https://github.com/madsci1016/Sparkfun-MP3-Player-Shield-Arduino-Library/tree/master/plugins (which also includes a perl file to convert the files from vlsi.fi)

from adafruit_vs1053_library.

jtlechem avatar jtlechem commented on July 25, 2024

Thank you, I did my best but doesn't seem to work. I copied that _patchVS1053() function into my Arduino script to just call it locally. Had to tweak a couple things like
sdfat::File32 file = _SD.open("patches.053", sdfat::O_READ); if (!file.isOpen()) { return false; }
to
File file = SD.open("/pshift.053", O_READ); if (!file) { return false; }
Doesn't throw any errors, but it doesn't seem to load. I tried the patches.053 and pshift.053 files.

Any good ways to simply use the original .plg file from https://www.vlsi.fi/en/support/software/vs10xxpatches.html ?

from adafruit_vs1053_library.

bimac avatar bimac commented on July 25, 2024

Here's how I did it - maybe this helps?

from adafruit_vs1053_library.

dgnuff avatar dgnuff commented on July 25, 2024

18 months later, here's the solution I used. The patches I used were downloaded from VLSI's web page at https://www.vlsi.fi/en/support/software/vs10xxpatches.html

I downloaded the vs1053b-patches290.zip file from the "VS1053b Patches w/ FLAC Decoder" section. When you look inside that ZIP, there are a bunch of .c files. Pick which one you want and extract it to your project. You'll need to rename it to a .cpp file, because it's going to works with the classes in Adafruit_VS1053.h

It'll have a small routine at the top that is #if 0ed out. and a couple of arrays: unsigned char atab[]; and unsigned short dtab[];. Leave all that alone, but first add the following #includes at the top:

#include <Arduino.h>
#include <SPI.h>
#include <SD.h>
#include <Adafruit_VS1053.h>

Then go to the bottom and append the following subroutine:

void VS1053Patch(Adafruit_VS1053_FilePlayer &musicPlayer)
{
    int i;
    for (i = 0; i < CODE_SIZE; i++)
    {
        musicPlayer.sciWrite(atab[i], dtab[i]);
    }
}

It'll probably also work if the type of the parameter is Adafruit_VS1053, since it only actually cares about one routine in there, and it's inherited from the base Adafruit_VS1053 class.

Add a prototype for that function to your main sketch, and call it immediately after you initially begin() the player, or any time you do a hard or soft reset on it.

I could probably hack together a script to convert the data in the .c file to something that the applyPatch() routine would accept, but I can't be bothered. In the grand scheme of things, the memory saving would be so miniscule by comparison with the ram available on the ESP32-S2 I'm using that it's just not worth my time.

from adafruit_vs1053_library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.