|
arduino-audio-tools
|
ESP32 AudioSource for AudioPlayer using an SD card as data source. This class is based on the Arduino SD_MMC implementation Connect the SD card to the following pins: More...
#include <AudioSourceSDMMC.h>
Public Member Functions | |
| AudioSourceSDMMC (const char *startFilePath="/", const char *ext=".mp3", bool setupIndex=true) | |
| Default constructor. | |
| virtual bool | begin () override |
| Reset actual stream and move to root. | |
| void | end () |
| int | index () |
| Provides the current index position. | |
| virtual bool | isAutoNext () |
| Returns default setting go to the next. | |
| virtual Stream * | nextStream (int offset=1) override |
| Returns next audio stream. | |
| Stream * | operator[] (int idx) |
| access with array syntax | |
| virtual Stream * | previousStream (int offset) |
| Returns previous audio stream. | |
| virtual Stream * | selectStream (const char *path) override |
| Returns audio stream by path: The index is not changed! | |
| virtual Stream * | selectStream (int index) override |
| void | setFileFilter (const char *filter) |
| virtual Stream * | setIndex (int index) |
| same as selectStream - I just prefer this name | |
| virtual bool | setMetadataCallback (void(*fn)(MetaDataType info, const char *str, int len), ID3TypeSelection sel=SELECT_ICY) |
| virtual void | setPath (const char *p) |
| Allows to "correct" the start path if not defined in the constructor. | |
| virtual void | setTimeout (int millisec) |
| Sets the timeout of Stream in milliseconds. | |
| virtual void | setTimeoutAutoNext (int millisec) |
| long | size () |
| Provides the number of files (The max index is size()-1): WARNING this is very slow if you have a lot of files in many subdirectories. | |
| virtual int | timeoutAutoNext () |
| Provides the timeout which is triggering to move to the next stream. | |
| const char * | toStr () |
| provides the actual file name | |
Protected Attributes | |
| const char * | exension = nullptr |
| File | file |
| const char * | file_name |
| const char * | file_name_pattern = "*" |
| SDDirect< fs::SDMMCFS, fs::File > | idx {SD_MMC} |
| size_t | idx_pos = 0 |
| bool | is_sd_setup = false |
| bool | setup_index = true |
| const char * | start_path = nullptr |
| int | timeout_auto_next_value = 500 |
ESP32 AudioSource for AudioPlayer using an SD card as data source. This class is based on the Arduino SD_MMC implementation Connect the SD card to the following pins:
SD Card | ESP32 D2 12 D3 13 CMD 15 VSS GND VDD 3.3V CLK 14 VSS GND D0 2 (add 1K pull up after flashing) D1 4
On the AI Thinker boards the pin settings should be On, On, On, On, On,
|
inlineoverridevirtual |
Reset actual stream and move to root.
Implements AudioSource.
|
inlinevirtual |
Provides the current index position.
Reimplemented from AudioSource.
|
inlinevirtual |
Returns default setting go to the next.
Reimplemented from AudioSource.
|
inlineoverridevirtual |
Returns next audio stream.
Implements AudioSource.
|
inlinevirtualinherited |
Returns previous audio stream.
Reimplemented in AudioSourceFTP< ClientType >, and AudioSourceURL.
|
inlineoverridevirtual |
Returns audio stream by path: The index is not changed!
Implements AudioSource.
|
inlineoverridevirtual |
Returns audio stream at the indicated index (the index is zero based, so the first value is 0!)
Reimplemented from AudioSource.
|
inline |
Defines the regex filter criteria for selecting files. E.g. ".*Bob Dylan.*"
|
inlinevirtualinherited |
Sets the timeout of Stream in milliseconds.
Reimplemented in AudioSourceURL, and AudioSourceSDFAT< AudioFs, AudioFile >.
|
inlinevirtualinherited |
Sets the timeout which is triggering to move to the next stream. - the default value is 500 ms
|
inlinevirtual |
provides the actual file name
Reimplemented from AudioSource.