engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | 所有成员列表
Audio::IAudioEncoder类 参考abstract

IAudioEncoder Interface used to implement a runtime audio encoder. 更多...

#include <IAudioEncoder.h>

被 FOggVorbisEncoder, FOpusEncoder , 以及 FWavEncoder 继承.

Public 成员函数

bool EncodeIfPossible ()
 If you'd like to run audio encoding on a separate thread, use this call. 更多...
 
int64 Finalize ()
 Call this once you are finished pushing audio. 更多...
 
virtual int32 GetCompressedPacketSize () const =0
 Used for internet streaming. 更多...
 
 IAudioEncoder (uint32 AudioBufferSlack, uint32 DataBufferSlack=4096)
 Must be constructed with AudioBufferSlack. 更多...
 
int32 PopData (uint8 *OutData, int32 DataSize)
 Pop compressed data. 更多...
 
bool PushAudio (const float *InBuffer, int32 NumSamples, bool bEncodeIfPossible=true)
 Call this function when audio is available. 更多...
 

Protected 成员函数

virtual bool EncodeChunk (const TArray< float > &InAudio, TArray< uint8 > &OutBytes)=0
 Override this to compress InAudio to OutBytes. 更多...
 
virtual bool EndFile (TArray< uint8 > &OutBytes)=0
 Override this to compress InAudio to OutBytes. 更多...
 
void Init (const FSoundQualityInfo &InQualityInfo)
 Should be called in the constructor of any implementation of IAudioEncoder. 更多...
 
virtual int64 SamplesRequiredPerEncode () const =0
 How many samples of decoded audio that are required for a single compression operation.
 
virtual bool StartFile (const FSoundQualityInfo &InQualityInfo, TArray< uint8 > &OutFileStart)=0
 This should be overridden to, give the properties in InQualityInfo, write a header into OutFileStart. 更多...
 

详细描述

IAudioEncoder Interface used to implement a runtime audio encoder.

构造及析构函数说明

◆ IAudioEncoder()

Audio::IAudioEncoder::IAudioEncoder ( uint32  AudioBufferSlack,
uint32  DataBufferSlack = 4096 
)

Must be constructed with AudioBufferSlack.

Optionally, DataBufferSlack can be called with a different value depending on how often PushAudio, EncodeIfPossible, or PopData will be called.

成员函数说明

◆ EncodeChunk()

virtual bool Audio::IAudioEncoder::EncodeChunk ( const TArray< float > &  InAudio,
TArray< uint8 > &  OutBytes 
)
protectedpure virtual

Override this to compress InAudio to OutBytes.

Returns true on success, false on failure.

◆ EncodeIfPossible()

bool Audio::IAudioEncoder::EncodeIfPossible ( )

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

Otherwise, ensure that bEncodeIfPossible is set to true when you call PushAudio.

◆ EndFile()

virtual bool Audio::IAudioEncoder::EndFile ( TArray< uint8 > &  OutBytes)
protectedpure virtual

Override this to compress InAudio to OutBytes.

Returns true on success, false on failure.

◆ Finalize()

int64 Audio::IAudioEncoder::Finalize ( )

Call this once you are finished pushing audio.

Returns the amount of bytes left to pop if positive, and if negative indicates a failiure.

◆ GetCompressedPacketSize()

virtual int32 Audio::IAudioEncoder::GetCompressedPacketSize ( ) const
pure virtual

Used for internet streaming.

Should return the amount of bytes required for a self contained packet.

◆ Init()

void Audio::IAudioEncoder::Init ( const FSoundQualityInfo &  InQualityInfo)
protected

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

Calls StartFile if necessary.

◆ PopData()

int32 Audio::IAudioEncoder::PopData ( uint8 *  OutData,
int32  DataSize 
)

Pop compressed data.

If you are using this encoder for streaming over network, use the size returned by GetCompressedPacketSize(). Returns number of bytes written.

◆ PushAudio()

bool Audio::IAudioEncoder::PushAudio ( const float *  InBuffer,
int32  NumSamples,
bool  bEncodeIfPossible = true 
)

Call this function when audio is available.

If you would like to handle compression on a separate thread or call, Call this function with bEncodeIfPossible set to false. Returns true if audio was successfully pushed, false, if the internal buffer is full.

◆ StartFile()

virtual bool Audio::IAudioEncoder::StartFile ( const FSoundQualityInfo &  InQualityInfo,
TArray< uint8 > &  OutFileStart 
)
protectedpure virtual

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

returns true on success, or false on failure.


该类的文档由以下文件生成: