3 #include "AudioLogger.h"
4 #include "AudioTools/CoreAudio/AudioSource.h"
5 #include "AudioTools/AudioLibs/SDDirect.h"
20 start_path = startFilePath;
27 while (!SPIFFS.begin()) {
28 LOGE(
"SPIFFS.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 = SPIFFS.open(file_name);
54 return file ? &file :
nullptr;
59 file = SPIFFS.open(path);
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 const char *file_name;
89 const char *exension =
nullptr;
90 const char *start_path =
nullptr;
91 const char *file_name_pattern =
"*";
92 bool is_sd_setup =
false;