Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: use of usdfs or sdFs in an audio object

  1. #1
    Junior Member
    Join Date
    Oct 2019

    use of usdfs or sdFs in an audio object

    Hi everybody,
    i'm currently trying to create a granular object who would play sound from an Sd card but the sd.h library is too slow for my purpose( goal is to load large buffer from card like 4096 bits so i can play more than one grain simultaneously).
    I have seen the benchmark and tried to use sdfs and usdfs lib it work, but i can't figure out how could i use one of these library in an audio object : Everytime i try to include , it does an error.
    I think it maybe has to do with the spi interrupt or the way the audio library handle the SD.h library ?
    Is there a way to make it work?

    for exemple:

    arduino code :
    #include "usdfs_finder.h"
    #include "Audio.h"
    //#include "AudioStream.h"
    void setup() {
      // put your setup code here, to run once:
    void loop() {
      // put your main code here, to run repeatedly:

    usdfs_finder.h :
    #ifndef usdfs_finder_h
    #define usdfs_finder_h
    // #include "Arduino.h"
    // #include "AudioStream.h"
    // #include "SD.h"
    // #include "SdFs.h"
    // #include <SD.h>
      void function_1();
      void function_2();
    usdfs_finder.cpp :
    #include "usdfs_finder.h"
    #include "Arduino.h"
    // #include "SdFs.h"
    #include "uSDFS.h"
    // #include "spi_interrupt.h"
    // #include <SD.h>
    void function_1()
      Serial.println("Fonction #1");
    void function_2()
      Serial.println("Fonction #2");
    Thanks in advance
    Last edited by tomatokotom; 11-13-2019 at 06:43 PM. Reason: code edit

  2. #2
    Senior Member
    Join Date
    Feb 2015
    It's possible. See my post here for sample code including hacks to the Audio library:

    It's only working on T3.6 currently, not T4, and I haven't seen a reply from Bill regarding T4.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts