Add buffering to MP3 streaming

The buffer class seems to work very well to avoid hiccups while
streaming from the web, so add it by default to the example to
make it easier for users to cut-n-paste and make it work.
This commit is contained in:
Earle F. Philhower, III committed 2017-11-20 12:15:32 -08:00
1 parent 8b080899af
commit 9c3f579c96
3 files changed
+26 -2

No files matched your search

+3
View File
@@ -41,12 +41,15 @@ class AudioFileSourceHTTPStream : public AudioFileSource
virtual bool isOpen() override;
virtual uint32_t getSize() override;
virtual uint32_t getPos() override;
bool SetReconnect(bool val) { reconnect = val; return true; }
private:
uint32_t readInternal(void *data, uint32_t len, bool nonBlock);
HTTPClient http;
int pos;
int size;
bool reconnect;
char *saveURL;
};