• I now get a different problem: little bits of the audio are repeating.

    Yes, that'll be the time it takes Espruino to load the data off the SD card. As @DrAzzy says, you might be able to bump the clock rate of the SD card's SPI up:

    require('fs').readdir(); // force SD card to get mounted
    SPI2.setup({sck:B13, miso:B14, mosi:B15, baud:4000000}); // now re-setup SPI
    

    But I don't think you'll get a huge amount better. While the documentation mentions 20KHz, that's when playing a file that's already loaded into RAM - trying to stream it off the SD card as well is substantially more painful for Espruino.

About

Avatar for Gordon @Gordon started