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,36 @@
/**
* @file streams-url-post.ino
* @author Phil Schatzmann
* @brief example how to http post data from an input stream
* @copyright GPLv3
*/
#include "AudioTools.h"
#include "AudioTools/Communication/AudioHttp.h"
AudioInfo info(44100, 2, 16);
SineWaveGenerator<int16_t> sineWave(32000);
GeneratedSoundStream<int16_t> sound(sineWave);
TimedStream timed(sound);
URLStream url("ssid", "password");
// Arduino Setup
void setup(void) {
// Open Serial
Serial.begin(115200);
AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);
// Setup sine wave
sineWave.begin(info, N_B4);
// limit the size of the input stream
timed.setEndSec(60);
timed.begin();
// post the data
url.begin("http://192.168.1.35:8000", "audio/bin", POST, "text/html", timed);
}
// Arduino loop - copy sound to out
void loop() {}