This commit is contained in:
2026-02-12 21:00:02 -08:00
parent 77f8236347
commit 8bdbf227ca
1141 changed files with 1010880 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
# Display RAW Stream
Sometimes it is handy to check out the data on the screen with the help of the Arduino Serial Monitor and Serial Plotter.
We read the raw binary data from an URLStream.
As output stream we use a CsvOutput: this class transforms the data into CSV and prints the result to Serial. Finally we can use the Arduino Serial Plotter to view the result as chart:
![serial-plotter](https://pschatzmann.github.io/Resources/img/serial-plotter-01.png)

View File

@@ -0,0 +1,41 @@
/**
* @file streams-url_raw-serial.ino
* @author Phil Schatzmann
* @brief see https://github.com/pschatzmann/arduino-audio-tools/blob/main/examples/examples-stream/streams-url_raw-serial/README.md
* @author Phil Schatzmann
* @copyright GPLv3
*/
#include "WiFi.h"
#include "AudioTools.h"
#include "AudioTools/Communication/AudioHttp.h"
URLStream music; // Music Stream
int channels = 2; // The stream has 2 channels
CsvOutput<int16_t> printer(Serial, channels); // ASCII stream
StreamCopy copier(printer, music); // copies music into printer
// Arduino Setup
void setup(void) {
// Open Serial
Serial.begin(115200);
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);
// connect to WIFI
WiFi.begin("network-name", "password");
while (WiFi.status() != WL_CONNECTED){
Serial.print(".");
delay(500);
}
// open music stream - it contains 2 channels of int16_t data
music.begin("https://pschatzmann.github.io/Resources/audio/audio.raw");
}
// Arduino loop - repeated processing
void loop() {
copier.copy();
}