summaryrefslogtreecommitdiffstats
path: root/Whisper/MF/AudioBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'Whisper/MF/AudioBuffer.h')
-rw-r--r--Whisper/MF/AudioBuffer.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Whisper/MF/AudioBuffer.h b/Whisper/MF/AudioBuffer.h
index 93a6ace..b12dff4 100644
--- a/Whisper/MF/AudioBuffer.h
+++ b/Whisper/MF/AudioBuffer.h
@@ -43,5 +43,14 @@ namespace Whisper
if( !stereo.empty() )
stereo.resize( len * 2 );
}
+
+ void dropFirst(size_t len)
+ {
+ assert(len <= mono.size());
+ size_t remainder = mono.size() - len;
+ auto tmp = std::vector<float>(remainder);
+ memcpy(tmp.data(), mono.data() + len, remainder);
+ mono = std::move(tmp);
+ }
};
} \ No newline at end of file