File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
examples/SnapClientVS1053 Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* *
2
+ * @brief SnapClient where the decoding is done by a VS1053 module.
3
+ * This module supports: Ogg Vorbis / MP3 / AAC / WMA / FLAC / MIDI / WAV so
4
+ * we can copy the received stream as is to the module.
5
+ * DRAFT: not tested!
6
+ * @author Phil Schatzmann
7
+ * @copyright GPLv3
8
+ */
9
+ #include " AudioTools.h"
10
+ #include " SnapClient.h"
11
+ #include " AudioLibs/VS1053Stream.h"
12
+
13
+
14
+ VS1053Stream out; // final output
15
+ WiFiClient wifi;
16
+ SnapTimeSyncDynamic synch (172 , 10 ); // optional configuratioin
17
+ CopyDecoder codec;
18
+ SnapClient client (wifi, out, codec);
19
+
20
+ void setup () {
21
+ Serial.begin (115200 );
22
+
23
+ // login to wifi -> Define values in SnapConfig.h or replace them here
24
+ WiFi.begin (CONFIG_WIFI_SSID, CONFIG_WIFI_PASSWORD);
25
+ Serial.print (" Connecting to WiFi .." );
26
+ while (WiFi.status () != WL_CONNECTED) {
27
+ Serial.print (' .' );
28
+ delay (1000 );
29
+ }
30
+
31
+ // print ip address
32
+ Serial.println ();
33
+ Serial.println (WiFi.localIP ());
34
+
35
+ // use full volume of VS1053
36
+ out.setVolume (1.0 );
37
+
38
+ // Define CONFIG_SNAPCAST_SERVER_HOST in SnapConfig.h or here
39
+ // client.setServerIP(IPAddress(192,168,1,38));
40
+
41
+ // start snap client
42
+ client.begin (synch);
43
+ }
44
+
45
+ void loop () {
46
+ client.doLoop ();
47
+ }
You can’t perform that action at this time.
0 commit comments