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
- NBuffer (Multi buffer for writing and reading of (audio) data)
12
12
- TimerAlarmRepeating (e.g. for sampling audio data using exact times) [ESP32 only]
13
13
- A Wav Encoder and Decoder
14
-
- AudioOutputWithCallback class to provide callback integration with ESP8266Audio
14
+
- AudioOutputWithCallback class to provide callback integration e.g. with ESP8266Audio
15
15
16
16
This functionality provides the glue which makes different audio processing components and libraries work together.
17
-
We also provide plenty of examples that demonstrate how to implement the different scenarios.
17
+
We also provide plenty of examples that demonstrate how to implement the different scenarios. The __design philosophy__ is based on the Arduino conventions: we use the ```begin()``` and ```end()``` methods to start and stop the processing and we propagate the __use of Streams__. We all know the Arduino Streams. We use them to write out print messages and sometimes we use them to read the output from Serial devices. The same thing applies to my “Audio Streams”: You can read audio data from “Audio Sources” and you write them to “Audio Sinks”.
18
18
19
-
The design philosophy is based on the Arduino conventions: we use the ```begin()``` and ```end()``` methods to start and stop the processing and we propagate the use of Streams.
19
+
As “Audio Sources” we will have e.g.:
20
20
21
+
- Analog Microphones – AnalogStream
22
+
- Digital Microphonse – I2SStream
23
+
- Files on the Internet – UrlStream
24
+
- Generated Sound – GeneratedSoundStream
25
+
- Mobile Phone A2DP Bluetooth – A2DPStream
26
+
- Binary Data in Flash Memory – MemoryStream
27
+
- SD Files
21
28
22
-
## Optional Libraries
29
+
As “Audio Sinks” we will have e.g:
23
30
24
-
Dependent on the example you might need to install some of the following libraries:
31
+
- external DAC – I2SStream
32
+
- an Amplifier – AnalogStream
33
+
- Bluetooth Speakers – A2DPStream
34
+
- Serial to display the data as CSV – CsvStream.
35
+
- SD Files
36
+
37
+
Here is an simple example which streams a file from the Flash Memory and writes it to I2S:
The examples follow the following naming convention: "scenario type"-"source"-"destination". For the scenario types we might have __base__ (using basic api functionality), __stream__ for examples using Streams and __test__ for the test cases.
30
76
77
+
For the __source__ we currently have __adc__ for analog input devices like analog microphones, __i2s__ for digital input devices (e.g. digital microphones), __file__ for SD files and __a2dp__ for input from Bluetooth A2DP (e.g. from a Mobile Phone).
31
78
32
-
# Examples
79
+
For the __destination__ we use __dac__ for analog output (e.g. to an amplifier), __i2s__ for digital output devices (e.g. an external DAC), __file__ for SD files and __a2dp__ for output to Bluetooth A2DP (e.g. a Bluetooth Speaker).
80
+
81
+
82
+
Here is the list of examples:
83
+
84
+
#### Stream API
85
+
86
+
-[streams-url_raw-serial](/examples/streams-url_raw-serial) Displaying a music file from the internet on the Serial Plotter
87
+
-[streams-generator-serial](/examples/streams-generator-serial) Displaying generated sound on the Serial Plotter
88
+
-[streams-adc-serial](/examples/streams-adc-serial) Displaying input from analog microphone on the Serial Plotter
89
+
-[streams-i2s-a2dp](examples/streams-i2s-a2dp) - Sample analog sound and write it to a A2DP Bluetooth source
90
+
-[streams-file_raw-a2dp](examples/streams-file_raw-a2dp) - Read Raw File from SD card write it A2DP Bluetooth
91
+
-[streams-adc-a2dp](examples/streams-adc-a2dp) - Sample analog sound from analog microphone and send it to Bluetooth Speaker
92
+
-[streams-memory_raw-i2s_external_dac](examples/streams-memory_raw-i2s_external_dac) - Play music form Flash Memory via I2S to External DAC
93
+
94
+
... these are just a few examples, but you can combine any Input Stream with any Output Stream as you like...
95
+
96
+
#### Basic API
97
+
98
+
-[base-adc-serial](examples/base-adc-serial) - Sample analog sound and write it to Serial
99
+
-[base-adc-a2dp](examples/base-adc-a2dp) - Sample analog sound and write it to a A2DP Bluetooth source
100
+
-[base-file_raw-serial](examples/base-file_raw-serial) - Read Raw File from SD card to and write it to Serial
101
+
-[base-file_raw-a2dp](examples/base-file_raw-a2dp) - Read Raw File from SD card write it A2DP Bluetooth
102
+
-[base-file_mp3-a2dp](examples/base-file_mp3-a2dp) - Stream MP3 File from SD card to A2DP Bluetooth using the ESP8266Audio library
103
+
-[base-i2s-serial](examples/base-i2s-serial) - Sample digital sound and write it to Serial
104
+
-[base-i2s-a2dp](examples/base-i2s-a2dp) - Sample analog sound and write it to a A2DP Bluetooth source
105
+
106
+
107
+
108
+
## Optional Libraries
109
+
110
+
Dependent on the example you might need to install some of the following libraries:
111
+
112
+
-[ESP32-A2DP Library](https://github.com/pschatzmann/ESP32-A2DP) to support A2DP Bluetooth Audio
113
+
-[ESP8266Audio]() to play different audio Formats
114
+
-[SD Library](https://www.arduino.cc/en/reference/SD) to read and write files.
115
+
-[arduino-fdk-aac](https://github.com/pschatzmann/arduino-fdk-aac) to encode or decode AAC
33
116
34
-
-[adc-a2dp](examples/adc-a2dp) - Stream Analog input to A2DP Bluetooth
35
-
-[adc-serial](examples/adc-serial) - Stream Analog input to Serial
36
-
-[file_raw-a2dp](examples/file_raw-a2dp) - Stream Row File from SD card to A2DP Bluetooth
37
-
-[file_raw-serial](examples/file_raw-serial) - Stream Raw File from SD card to Serial
38
-
-[file_mp3-a2dp](examples/file_mp3-a2dp) - Stream MP3 File from SD card to A2DP Bluetooth using the ESP8266Audio library
39
-
-[i2s-a2dp](examples/i2s-a2dp) - Stream I2S Input to A2DP Bluetooth
40
-
-[i2s-serial](examples/i2s-serial) - Stream I2S Input to Serial
Here is the generated [Class documentation](https://pschatzmann.github.io/arduino-audio-tools/html/annotated.html). You might find further information in [one of my blogs](https://www.pschatzmann.ch/home/category/machine-sound/)
131
+
Here is the generated [Class documentation](https://pschatzmann.github.io/arduino-audio-tools/html/annotated.html).
132
+
133
+
You also might find further information in [one of my blogs](https://www.pschatzmann.ch/home/category/machine-sound/)
56
134
57
135
## Project Status
58
136
@@ -63,7 +141,7 @@ This is currently work in progress:
Unfortunatly Arduino does not provide an I2S functionality which is standrdized acress the different processors. There is only an official documentation for SAMD21 processors. The full functionality of the library is currently only available on the ESP32:
0 commit comments