IAudioEncoder

[IAudioEncoder](API\Runtime\SignalProcessing\DSP\Encoders\IAudioEncoder) Interface used to implement a runtime audio encoder.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

SignalProcessing

Header

/Engine/Source/Runtime/SignalProcessing/Public/DSP/Encoders/IAudioEncoder.h

Include

#include "DSP/Encoders/IAudioEncoder.h"

Syntax

class IAudioEncoder

Remarks

IAudioEncoder Interface used to implement a runtime audio encoder.

Constructors

Name Description

Public function

IAudioEncoder

(
    uint32 AudioBufferSlack,
    uint32 DataBufferSlack
)

Must be constructed with AudioBufferSlack.

Destructors

Name Description

Public function Virtual

~IAudioEncoder()

Functions

Name Description

Protected function

bool

 

EncodeChunk

(
    const TArray< float >& InAudio,
    TArray< uint8 >& OutBytes
)

Override this to compress InAudio to OutBytes. Returns true on success, false on failure.

Public function

bool

 

EncodeIfPossible()

If you'd like to run audio encoding on a separate thread, use this call.

Protected function

bool

 

EndFile

(
    TArray< uint8 >& OutBytes
)

Override this to compress InAudio to OutBytes. Returns true on success, false on failure.

Public function

int64

 

Finalize()

Call this once you are finished pushing audio.

Public function Const

int32

 

GetCompressedPacketSize()

Used for internet streaming.

Protected function

void

 

Init

(
    const FSoundQualityInfo& InQuality...
)

Should be called in the constructor of any implementation of IAudioEncoder.

Public function

int32

 

PopData

(
    uint8* OutData,
    int32 DataSize
)

Pop compressed data.

Public function

bool

 

PushAudio

(
    const float* InBuffer,
    int32 NumSamples,
    bool bEncodeIfPossible
)

Call this function when audio is available.

Protected function Const

int64

 

SamplesRequiredPerEncode()

How many samples of decoded audio that are required for a single compression operation.

Protected function

bool

 

StartFile

(
    const FSoundQualityInfo& InQuality...,
    TArray< uint8 >& OutFileStart
)

This should be overridden to, give the properties in InQualityInfo, write a header into OutFileStart.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss