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 (!SPIFFS.begin()) {
29 LOGE(
"SPIFFS.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 = SPIFFS.open(file_name);
55 return file ? &file :
nullptr;
60 file = SPIFFS.open(path);
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 const char *file_name;
90 const char *exension =
nullptr;
91 const char *start_path =
nullptr;
92 const char *file_name_pattern =
"*";
93 bool is_sd_setup =
false;