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

Thread: How do I save the Audio data to the SD Card?

  1. #1

    How do I save the Audio data to the SD Card?

    Question on saving Audio data to the SD Card on Teensy 4.1

    There is a conflict when I #include "SdFat-beta.h" and #include <Audio.h>.

    Here is the SD card code, and it works.

    #include "SdFat-beta.h"

    SdExFat sd;

    void setup()
    {
    if (!sd.begin(SdioConfig(FIFO_SDIO))) { // SdFat.h Ver 2.0.0 Beta
    Serial.println("m.SD initialization failed!");
    } else {
    Serial.println("m.SD initialization OK");
    }

    auto file = sd.open("data.txt", FILE_WRITE);
    file.write("123");
    file.close();
    }

    void loop()
    {

    }


    But when I include <Audio.h>, there is a warning: "FILE_READ" redefined
    #define FILE_READ O_READ

    warning: "FILE_WRITE" redefined
    #define FILE_WRITE (O_READ | O_WRITE | O_CREAT)

    error: using typedef-name 'File' after 'class'
    class File : public Stream {

  2. #2
    Senior Member
    Join Date
    Jul 2014
    Posts
    3,159
    with latest TD (1.54b7) you do NOT include SdFat-beta, but you use SD.h, which is now an interface to SdFat-V2 (prev SdFat-beta)

Posting Permissions

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