#include <SlidingWindow.h>
类 Audio::TAutoSlidingWindow< InSampleType, InAllocator > 继承关系图:Public 成员函数 | |
| TAutoSlidingWindowIterator | begin () |
| Creates STL like iterator which slides over samples. 更多... | |
| TAutoSlidingWindowIterator | end () |
| Creates STL like iterator denotes the end of the sliding window. 更多... | |
| TAutoSlidingWindow (TSlidingBuffer< InSampleType > &InBuffer, TArrayView< const InSampleType > InNewBuffer, TArray< InSampleType, InAllocator > &OutWindow, bool bDoFlush=false) | |
| TAutoSlidingWindow constructor 更多... | |
Public 成员函数 继承自 Audio::TScopedSlidingWindow< InSampleType > | |
| TScopedSlidingWindow (TSlidingBuffer< InSampleType > &InSlidingBuffer, TArrayView< const InSampleType > InNewBuffer, bool bDoFlush=false) | |
| TScopedSlidingWindow constructor 更多... | |
| virtual | ~TScopedSlidingWindow () |
| Calls InSlidingBuffer.StoreForFutureWindows(InNewBuffer). | |
Public 成员函数 继承自 Audio::TSlidingWindow< InSampleType > | |
| template<typename InAllocator = FDefaultAllocator> | |
| TSlidingWindowIterator< InAllocator > | begin (TArray< InSampleType, InAllocator > &OutWindowBuffer) const |
| Creates STL like iterator which slides over samples. 更多... | |
| template<typename InAllocator = FDefaultAllocator> | |
| TSlidingWindowIterator< InAllocator > | end (TArray< InSampleType, InAllocator > &OutWindowBuffer) const |
| Creates STL like iterator denotes the end of the sliding window. 更多... | |
| TSlidingWindow (const TSlidingBuffer< InSampleType > &InSlidingBuffer, TArrayView< const InSampleType > InNewBuffer, bool bDoFlush) | |
| TSlidingWindow constructor 更多... | |
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.