![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <SlidingWindow.h>
Inheritance diagram for Audio::TAutoSlidingWindow< InSampleType, InAllocator >:Additional Inherited Members | |
Protected Attributes inherited from Audio::TSlidingWindow< InSampleType > | |
| TArrayView< const InSampleType > | StorageBuffer |
| TArrayView< const InSampleType > | NewBuffer |
| const int32 | NumWindowSamples |
| const int32 | NumHopSamples |
TAutoSlidingWindow enables use of a sliding window within a range-based for loop.
Example:
void ProcessAudio(TSlidingBuffer<float>& SlidingBuffer, const TArray<float>& NewSamples) { TArray<float> WindowData; TAutoSlidingWindow<float> SlidingWindow(SlidingBuffer, NewSamples, WindowData);
for (TArray<float>& Window : SlidingWindow) { ... audio processing on single window here } }
int main() { int32 NumWindowSamples = 4; int32 NumHopSamples = 2; TSlidingBuffer<float> SlidingBuffer(NumWindowSamples, NumHopSamples);
TArray<float> Buffer1({1, 2, 3, 4, 5, 6, 7});
ProcessAudio(SlidingBuffer, Buffer1);
TArray<float> Buffer2({8, 9, 10, 11});
ProcessAudio(SlidingBuffer, Buffer2); }
|
inline |
TAutoSlidingWindow constructor
InSlidingBuffer Holds the previous samples which were not completely used in previous sliding windows. It also defines the window and hop size. InNewBuffer Holds new samples which have not yet been ingested by the InSlidingBuffer. OutWindow is shared by all iterators created by calling begin() or end(). bDoFlush Controls whether zeros to the final output windows until all possible windows with data from InNewBuffer have been covered.
|
inline |
Creates STL like iterator which slides over samples.
This iterator maintains a reference to the OutWindow passed into the constructor. That array will be manipulated when the iterator's * operator is called.
|
inline |
Creates STL like iterator denotes the end of the sliding window.
This iterator maintains a reference to the OutWindow passed into the constructor. That array will be manipulated when the iterator's * operator is called.