Files
klubhaus-doorbell/libraries/audio-tools/examples/examples-communication/a2dp/streams-a2dp-serial/streams-a2dp-serial.ino
2026-02-12 21:00:02 -08:00

33 lines
728 B
C++

/**
* @file streams-a2dp-serial.ino
* @author Phil Schatzmann
* @brief see https://github.com/pschatzmann/arduino-audio-tools/blob/main/examples/examples-stream/streams-a2dp-serial/README.md
*
* @author Phil Schatzmann
* @copyright GPLv3
*
*/
#include "AudioTools.h"
#include "AudioTools/Communication/A2DPStream.h"
A2DPStream in;
CsvOutput<int16_t> out(Serial, 2); // ASCII stream as csv
StreamCopy copier(out, in); // copy in to out
// Arduino Setup
void setup(void) {
Serial.begin(115200);
// start the bluetooth audio receiver
Serial.println("starting A2DP...");
auto cfg = in.defaultConfig(RX_MODE);
cfg.name = "MyReceiver";
in.begin(cfg);
}
// Arduino loop
void loop() {
copier.copy();
}