3 #include "AudioBasic/StrExt.h"
4 #include "AudioLogger.h"
5 #include "AudioTools/AudioSource.h"
6 #include "AudioLibs/SDDirect.h"
21 start_path = startFilePath;
28 while (!LittleFS.begin()) {
29 LOGE(
"LittleFS.begin failed");
34 idx.begin(start_path, exension, file_name_pattern);
44 LOGI(
"nextStream: %d", offset);
49 LOGI(
"selectStream: %d",
index);
51 file_name = idx[
index];
52 if (file_name==
nullptr)
return nullptr;
53 LOGI(
"Using file %s", file_name);
54 file = LittleFS.open(file_name,
"r");
55 return file ? &file :
nullptr;
60 file = LittleFS.open(path,
"r");
61 file_name = file.name();
62 LOGI(
"-> selectStream: %s", path);
63 return file ? &file :
nullptr;
74 const char *
toStr() {
return file_name; }
80 virtual void setPath(
const char *p) { start_path = p; }
89 SDDirect<fs::LittleFSFS,fs::File> idx{LittleFS};
93 const char *file_name;
94 const char *exension =
nullptr;
95 const char *start_path =
nullptr;
96 const char *file_name_pattern =
"*";
97 bool is_sd_setup =
false;