8# include "esp_system.h"
9# include "esp32-hal-log.h"
11#elif defined(IS_DESKTOP)
13# define memcpy_P memcpy
17#elif defined(ARDUINO) && __has_include(<pgmspace.h>)
22# define USE_RAM_DEFAUT false
25#define VFS_INC_SIZE 10
27#define MIN(a,b) ((a) < (b) ? (a) : (b))
34extern VFS_FD **registry;
35extern int registry_last_entry;
36extern bool registry_use_ram;
54 MemoryFS(
const unsigned char *raw=NULL,
unsigned int size=0,
int bytesPerSample=2,
bool swapBytes=
true);
55 MemoryFS (
const char* fileName);
58 static VFS_FD *
registerFile(
const char* fileName,
const unsigned char *raw,
unsigned int size);
60 bool open(
const char* fileName,
int bytesPerSample=2);
75 registry_use_ram = ram;
82 int16_t *data_ =
nullptr;
83 bool swapBytes =
true;
86 static VFS_FD* findByName(
const char * path);
static VFS_FD * registerFile(const char *fileName, const unsigned char *raw, unsigned int size)
makes the file available so that the open (by name) operation is working
void close()
sets to open flag to false
size_t getSize()
Returns a descriptor with additional information.
static void reset()
Clears all stored tables.
bool fileRead(StkFrames &buffer, unsigned long startFrame, bool doNormalize)
Reads the data into the buffer at the indicated start frame.
static void useRAM(bool ram)
Defines if the audio data is copied from progmem to RAM.
Definition MemoryFS.h:74
bool open(const char *fileName, int bytesPerSample=2)
opens the indicated file
bool isOpen()
checks if the file has been opened
An STK class to handle vectorized audio data.
Definition Stk.h:287
The STK namespace.
Definition ADSR.h:8