You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A streaming library for esp32, esp32-wrover, esp32-s2 and esp32-s3 with a separate VS1053 codec chip.<br>
6
6
This library plays mp3, ogg, aac, aac+ and <strike>flac</strike> files and streams and uses [ESP_VS1053_Library](https://github.com/baldram/ESP_VS1053_Library) to communicate with the decoder.
7
7
8
-
Supports http, https (insecure mode) and chunked audio streams.
8
+
This library plays http, https (insecure mode) and chunked audio files and streams.
9
+
Also plays mp3 and ogg files from sdcard.
9
10
10
11
Visit [eStreamPlayer32_VS1053 for PIO](https://github.com/CelliesProjects/eStreamplayer32-vs1053-pio) to see a [PlatformIO](https://platformio.org/platformio) project using this library.
11
12
@@ -15,12 +16,13 @@ Install [ESP_VS1053_Library](https://github.com/baldram/ESP_VS1053_Library) and
15
16
16
17
Take care to install the master branch of the VS1053 library or at least a version from commit [ba1803f](https://github.com/baldram/ESP_VS1053_Library/commit/ba1803f75722a36f3e9f539129e885bea3c60f71) or later because the `getChipVersion()` call that is needed is not included in the latest release.<br>See https://github.com/CelliesProjects/ESP32_VS1053_Stream/issues/23
17
18
18
-
Use [the latest Arduino ESP32 core version](https://github.com/espressif/arduino-esp32/releases/latest).
19
+
Use the [2.0.17 Arduino ESP32 core version](https://github.com/espressif/arduino-esp32/releases/tag/2.0.17).
Ogg files can not be started with an offset without first playing a couple of seconds from the start of the file.
99
139
100
140
## Tips for troublefree streaming
101
141
@@ -110,8 +150,6 @@ WiFi.setSleep(false);
110
150
...
111
151
```
112
152
113
-
<hr>
114
-
115
153
### Prevent reboots while playing
116
154
Early version of the esp32 have issues with the external psram cache, resulting in reboots.<br>Workarounds are possible depending on the hardware revision.
117
155
@@ -139,161 +177,103 @@ Source: [esp-idf api guide on external ram](https://docs.espressif.com/projects/
139
177
In PIO you can find out what hardware revision you have by running `esptool.py flash_id` in a terminal.
140
178
141
179
In Arduino IDE go to `File->Preferences` and find the `Show verbose output during` option. Check the box marked `upload`.<br>You can now see the hardware revision when you upload a sketch.
142
-
<hr>
143
180
144
181
# Functions
145
-
146
182
### Initialize the VS1053 codec
147
183
148
184
```c++
149
185
boolstartDecoder(CS, DCS, DREQ)
150
186
```
151
-
152
-
<hr>
153
-
154
187
### Check if VS1053 is responding
155
-
156
188
```c++
157
189
bool isChipConnected()
158
190
```
159
-
160
-
<hr>
161
-
162
191
### Start or resume a stream
163
192
164
193
```c++
165
194
boolconnecttohost(url)
166
195
```
167
-
168
196
```c++
169
197
bool connecttohost(url, offset)
170
198
```
171
-
172
199
```c++
173
200
boolconnecttohost(url, user, pwd)
174
201
```
175
-
176
202
```c++
177
203
bool connecttohost(url, user, pwd, offset)
178
204
```
179
-
180
-
<hr>
181
-
182
-
### Stop a stream
183
-
205
+
### Start or resume a local file
206
+
```c++
207
+
boolconnecttofile(filesystem, filename)
208
+
```
209
+
```c++
210
+
bool connecttofile(filesystem, filename, offset)
211
+
```
212
+
### Stop a running stream
184
213
```c++
185
214
voidstopSong()
186
215
```
187
-
188
-
<hr>
189
-
190
216
### Feed the decoder
191
-
192
217
```c++
193
218
voidloop()
194
219
```
195
-
196
220
This function has to called every couple of ms to feed the decoder with data.<br>For bitrates up to 320kbps somewhere between 5-25 ms is about right.
0 commit comments