3 #include "AudioLogger.h"
4 #include "AudioTools/CoreAudio/AudioSource.h"
5 #include "AudioTools/AudioLibs/SDDirect.h"
20 start_path = startFilePath;
27 while (!LittleFS.begin()) {
28 LOGE(
"LittleFS.begin failed");
33 idx.begin(start_path, exension, file_name_pattern);
43 LOGI(
"nextStream: %d", offset);
48 LOGI(
"selectStream: %d",
index);
50 file_name = idx[
index];
51 if (file_name==
nullptr)
return nullptr;
52 LOGI(
"Using file %s", file_name);
53 file = LittleFS.open(file_name,
"r");
54 return file ? &file :
nullptr;
59 file = LittleFS.open(path,
"r");
60 file_name = file.name();
61 LOGI(
"-> selectStream: %s", path);
62 return file ? &file :
nullptr;
73 const char *
toStr() {
return file_name; }
79 virtual void setPath(
const char *p) { start_path = p; }
88 SDDirect<fs::LittleFSFS,fs::File> idx{LittleFS};
92 const char *file_name;
93 const char *exension =
nullptr;
94 const char *start_path =
nullptr;
95 const char *file_name_pattern =
"*";
96 bool is_sd_setup =
false;