UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Audio::TAutoSlidingWindow< InSampleType, InAllocator > Class Template Reference

#include <SlidingWindow.h>

+ Inheritance diagram for Audio::TAutoSlidingWindow< InSampleType, InAllocator >:

Public Member Functions

 TAutoSlidingWindow (TSlidingBuffer< InSampleType > &InBuffer, TArrayView< const InSampleType > InNewBuffer, TArray< InSampleType, InAllocator > &OutWindow, bool bDoFlush=false)
 
TAutoSlidingWindowIterator begin ()
 
TAutoSlidingWindowIterator end ()
 
- Public Member Functions inherited from Audio::TScopedSlidingWindow< InSampleType >
 TScopedSlidingWindow (TSlidingBuffer< InSampleType > &InSlidingBuffer, TArrayView< const InSampleType > InNewBuffer, bool bDoFlush=false)
 
virtual ~TScopedSlidingWindow ()
 
- Public Member Functions inherited from Audio::TSlidingWindow< InSampleType >
 TSlidingWindow (const TSlidingBuffer< InSampleType > &InSlidingBuffer, TArrayView< const InSampleType > InNewBuffer, bool bDoFlush)
 
virtual ~TSlidingWindow ()
 
template<typename InAllocator = FDefaultAllocator>
TSlidingWindowIterator< InAllocatorbegin (TArray< InSampleType, InAllocator > &OutWindowBuffer) const
 
template<typename InAllocator = FDefaultAllocator>
TSlidingWindowIterator< InAllocatorend (TArray< InSampleType, InAllocator > &OutWindowBuffer) const
 

Additional Inherited Members

- Protected Attributes inherited from Audio::TSlidingWindow< InSampleType >
TArrayView< const InSampleTypeStorageBuffer
 
TArrayView< const InSampleTypeNewBuffer
 
const int32 NumWindowSamples
 
const int32 NumHopSamples
 

Detailed Description

template<typename InSampleType, typename InAllocator = FDefaultAllocator>
class Audio::TAutoSlidingWindow< InSampleType, InAllocator >

TAutoSlidingWindow

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); }

Constructor & Destructor Documentation

◆ TAutoSlidingWindow()

template<typename InSampleType , typename InAllocator = FDefaultAllocator>
Audio::TAutoSlidingWindow< InSampleType, InAllocator >::TAutoSlidingWindow ( TSlidingBuffer< InSampleType > &  InBuffer,
TArrayView< const InSampleType InNewBuffer,
TArray< InSampleType, InAllocator > &  OutWindow,
bool  bDoFlush = false 
)
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.

Member Function Documentation

◆ begin()

template<typename InSampleType , typename InAllocator = FDefaultAllocator>
TAutoSlidingWindowIterator Audio::TAutoSlidingWindow< InSampleType, InAllocator >::begin ( )
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.

◆ end()

template<typename InSampleType , typename InAllocator = FDefaultAllocator>
TAutoSlidingWindowIterator Audio::TAutoSlidingWindow< InSampleType, InAllocator >::end ( )
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.


The documentation for this class was generated from the following file: