From 0091d2748ad5546bfa90254a4ed29ad40da0a4d0 Mon Sep 17 00:00:00 2001 From: pschatzmann Date: Tue, 10 Dec 2024 10:13:52 +0100 Subject: [PATCH] MemoryStream setAvailable --- src/AudioTools/CoreAudio/AudioStreams.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/AudioTools/CoreAudio/AudioStreams.h b/src/AudioTools/CoreAudio/AudioStreams.h index 122c9c8ca..584b688f1 100644 --- a/src/AudioTools/CoreAudio/AudioStreams.h +++ b/src/AudioTools/CoreAudio/AudioStreams.h @@ -281,10 +281,16 @@ class MemoryStream : public AudioStream { return buffer != nullptr; } + /// Provides access to the data array virtual uint8_t* data(){ return buffer; } + /// update the write_pos (e.g. when we used data() to update the array) + virtual void setAvailable(size_t len) { + this->write_pos = len; + } + /// Callback which is executed when we rewind (in loop mode) to the beginning void setRewindCallback(void (*cb)()){ this->rewind = cb;