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
Copy file name to clipboardExpand all lines: README.md
+3-89Lines changed: 3 additions & 89 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,100 +16,14 @@ Supported audio codec chips are e.g
16
16
- ES7243
17
17
- etc
18
18
19
-
While you can use this library stand alone, I recommend to use it together with my [AudioTools](https://github.com/pschatzmann/arduino-audio-tools) project which provides a nice integration with it's [I2SCodecStream](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_i2_s_codec_stream.html) class.
19
+
While you can use this library stand alone, I recommend to use it together with my [AudioTools](https://github.com/pschatzmann/arduino-audio-tools) project which provides a nice integration with it's [I2SCodecStream](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_i2_s_codec_stream.html) class. Further information can be found in the [Wiki](https://github.com/pschatzmann/arduino-audio-driver/wiki).
20
20
21
-
## AudioTools
22
21
23
-
```C++
24
-
25
-
#include"AudioTools.h"
26
-
#include"AudioLibs/I2SCodecStream.h"
27
-
28
-
I2SCodecStream i2s(LyratV43);
29
-
30
-
void setup() {
31
-
// setup i2s and codec
32
-
auto cfg = i2s.defaultConfig();
33
-
cfg.sample_rate = 44100;
34
-
cfg.bits_per_sample = 16;
35
-
cfg.channels = 1;
36
-
i2s.begin();
37
-
// set volume
38
-
i2s.setVolume(0.5);
39
-
}
40
-
41
-
```
42
-
You can use the [I2SCodecStream](https://pschatzmann.github.io/arduino-audio-tools/classaudio__tools_1_1_i2_s_codec_stream.html) like the I2SStream but it provides some additional functionality, like setting the volume via the codec. In the __constructor__ you need to provide an __audio board__ object.
43
-
44
-
45
-
## Stand-Alone: Predefined Boards
46
-
47
-
A board definition consists of a driver class and pin definitions for that specific board. You can easily use the predefined boards. E.g. the following code is setting up and starting the codec on a Lyrat board:
48
-
49
-
```C++
50
-
51
-
#include "AudioBoard.h"
52
-
53
-
void setup() {
54
-
CodecConfig cfg;
55
-
cfg.adc_input = ADC_INPUT_LINE1;
56
-
cfg.dac_output = DAC_OUTPUT_ALL;
57
-
cfg.i2s.bits = BIT_LENGTH_16BITS;
58
-
cfg.i2s.rate = RATE_44K;
59
-
//cfg.i2s.fmt = I2S_NORMAL;
60
-
//cfg.i2s.mode = MODE_SLAVE;
61
-
LyratV43.begin(cfg);
62
-
63
-
}
64
-
65
-
```
66
-
67
-
Check the documentation for all available boards.
68
-
69
-
70
-
## Stand-Alone: Custom Boards
71
-
72
-
You can also easily define your custom boards by defining the __driver__ and your __specifc pins__
0 commit comments