From abeba9dd89f7331f5b20cee3013ac0cdfb52b6d2 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Mon, 26 Mar 2018 07:15:58 -0700 Subject: [PATCH] Limit speed SerialWAV can send samples, avoid WDT --- src/AudioOutputSerialWAV.cpp | 5 +++++ src/AudioOutputSerialWAV.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/AudioOutputSerialWAV.cpp b/src/AudioOutputSerialWAV.cpp index 8b65e26..159d692 100644 --- a/src/AudioOutputSerialWAV.cpp +++ b/src/AudioOutputSerialWAV.cpp @@ -45,11 +45,16 @@ bool AudioOutputSerialWAV::begin() wavHeader[34] = bps; wavHeader[35] = 0; Serial.write(wavHeader, sizeof(wavHeader)); + count = 0; return true; } bool AudioOutputSerialWAV::ConsumeSample(int16_t sample[2]) { + if (++count == 200) { + count = 0; + return false; + } for (int i=0; i