Skip to content

Commit 6edb490

Browse files
committed
README
1 parent 6f06896 commit 6edb490

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
### Feature list
88

99
- Header only C++ implementation
10-
- PCM, Opus, FLAC and Ogg decoding is supported
10+
- PCM, Opus decoding is supported
1111
- Auto connect to snapcast server on network
1212
- The functionality has been tested on an ESP32
1313
- Memory efficient implementation, so that PSRAM is not needed
1414
- Use any output device or DSP chain suppored by the [Audio Tools](https://github.com/pschatzmann/arduino-audio-tools)
15+
- Flexible design so that you can choose from different processor implementations and synchronizers.
16+
17+
The disadvantage of these goals iw that you might need to fine tune the solution to have it working as you want.
1518

1619
### Description
1720

@@ -24,11 +27,13 @@ Here is an example Arduino sketch that uses the Wifi as communication API, the W
2427
```C++
2528
#include "AudioTools.h"
2629
#include "SnapClient.h"
30+
#include "AudioCodecs/CodecOpus.h" // https://github.com/pschatzmann/arduino-libopus
31+
//#include "api/SnapProcessorRTOS.h" // install https://github.com/pschatzmann/arduino-freertos-addons
2732

28-
WAVDecoder pcm;
33+
OpusAudioDecoder codec;
2934
WiFiClient wifi;
3035
I2SStream out;
31-
SnapClient client(wifi, out, pcm);
36+
SnapClient client(wifi, out, codec);
3237

3338
void setup() {
3439
Serial.begin(115200);
@@ -50,8 +55,16 @@ void setup() {
5055
config.pin_bck = 14;
5156
config.pin_ws = 15;
5257
config.pin_data = 22;
58+
// cfg.buffer_size = 512;
59+
// cfg.buffer_count = 40;
5360
out.begin(cfg);
5461

62+
// Use FreeRTOS
63+
//client.setSnapProcessor(rtos);
64+
65+
// Define CONFIG_SNAPCAST_SERVER_HOST in SnapConfig.h or here
66+
// client.setServerIP(IPAddress(192,168,1,33));
67+
5568
// start snap client
5669
client.begin();
5770
}
@@ -61,7 +74,7 @@ void loop() {
6174
}
6275

6376
```
64-
Change the snapserver.conf to define ```codec = pcm``` and restart the snapserver with ```sudo service snapserver restart```.
77+
Change the snapserver.conf to define ```codec = opus``` and restart the snapserver with ```sudo service snapserver restart```.
6578
You can test now your sketch e.g. with ```ffmpeg -i http://stream.srg-ssr.ch/m/rsj/mp3_128 -f s16le -ar 48000 /tmp/snapfifo```
6679
6780
For further information on codecs please check the information in the Wiki!

0 commit comments

Comments
 (0)