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

Status
Not open for further replies.

feima0011

Well-known member
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 {
 
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)
 
Status
Not open for further replies.
Back
Top