FSampleBufferReader

Windows
MacOS
Linux

References

Module

SignalProcessing

Header

/Engine/Source/Runtime/SignalProcessing/Public/DSP/SampleBufferReader.h

Include

#include "DSP/SampleBufferReader.h"

Syntax

class FSampleBufferReader

Variables

Name Description

Protected variable

double

 

AlphaLerp

Protected variable

float

 

BasePitch

The current frame alpha.

Protected variable

bool

 

bIsFinished

Protected variable

bool

 

bIsScrubMode

Protected variable

int32

 

BufferNumChannels

Protected variable

int32

 

BufferNumFrames

Protected variable

int32

 

BufferNumSamples

Protected variable

const int16 ...

 

BufferPtr

Protected variable

int32

 

BufferSampleRate

Protected variable

bool

 

bWrap

Protected variable

double

 

CurrentBufferFrameIndexInterpolated

Protected variable

int32

 

CurrentFrameIndex

Protected variable

float

 

CurrentScrubWidthSec

Protected variable

float

 

CurrentSeekTime

Protected variable

ESeekType::Type

 

CurrentSeekType

Protected variable

float

 

DeviceSampleRate

Protected variable

int32

 

FadeFrames

Protected variable

float

 

FadeIncrement

Protected variable

float

 

FadeValue

Protected variable

int32

 

NextFrameIndex

Protected variable

Audio::FLinearE ...

 

Pitch

Protected variable

float

 

PitchScale

Protected variable

float

 

PlaybackProgress

Protected variable

double

 

ScrubAnchorFrame

Protected variable

double

 

ScrubMaxFrame

Protected variable

double

 

ScrubMinFrame

Protected variable

double

 

ScrubWidthFrames

Constructors

Name Description

Public function

FSampleBufferReader()

Destructors

Name Description

Public function

~FSampleBufferReader()

Functions

Name Description

Public function

void

 

ClearBuffer()

Clears current buffer and resets state.

Public function

bool

 

Generate

(
    float* OutAudioBuffer,
    const int32 NumFrames,
    const int32 OutChannels,
    const bool bWrap
)

Generates the next block of audio. Returns true if it's no longer playing (reached end of the buffer and not set to wrap)

Public function Const

int32

 

GetNumChannels()

Returns the number of channels of this buffer.

Public function Const

int32

 

GetNumFrames()

Returns the number of frames of the buffer.

Public function Const

float

 

GetPlaybackProgress()

Returns the current playback position in seconds.

Protected function

float

 

GetSampleValue

(
    const int16 * InBuffer,
    const int32 SampleIndex
)

Protected function

float

 

GetSampleValueForChannel

(
    const int32 Channel
)

Public function Const

bool

 

HasBuffer()

Whether or not the buffer reader has a buffer.

Public function

void

 

Init

(
    const int32 InSampleRate
)

Public function

void

 

SeekTime

(
    const float InTimeSec,
    const ESeekType::Type InSeekType,
    const bool bWrap
)

Seeks the buffer the given time in seconds. Returns true if succeeded.

Public function

void

 

SetBuffer

(
    const int16 * InBufferPtr,
    const int32 InNumBufferSamples,
    const int32 InNumChannels,
    const int32 InBufferSampleRate
)

This must be a completely loaded buffer. This buffer reader doesn't OWN the buffer memory.

Public function

void

 

SetPitch

(
    const float InPitch,
    const float InterpolationTimeSec
)

Sets the pitch of the buffer reader. Can be negative. Will linearly interpolate over the given time value.

Public function

void

 

SetScrubMode

(
    const bool bInIsScrubMode
)

Puts the wave reader into scrub mode.

Public function

void

 

SetScrubTimeWidth

(
    const float InScrubTimeWidthSec
)

Sets the scrub width. The sound will loop between the scrub width region and the current frame.

Protected function

void

 

UpdateScrubMinAndMax()

Protected function

void

 

UpdateSeekFrame()

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback