UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IVoiceEncoder Class Referenceabstract

#include <VoiceCodec.h>

+ Inheritance diagram for IVoiceEncoder:

Public Member Functions

virtual ~IVoiceEncoder ()
 
virtual bool Init (int32 SampleRate, int32 NumChannels, EAudioEncodeHint EncodeHint)=0
 
virtual int32 Encode (const uint8 *RawPCMData, uint32 RawDataSize, uint8 *OutCompressedData, uint32 &OutCompressedDataSize)=0
 
virtual bool SetBitrate (int32 InBitRate)=0
 
virtual bool SetVBR (bool bEnableVBR)=0
 
virtual bool SetComplexity (int32 InComplexity)=0
 
virtual void Reset ()=0
 
virtual void Destroy ()=0
 
virtual void DumpState () const =0
 
- Public Member Functions inherited from TSharedFromThis< IVoiceEncoder >
TSharedRef< IVoiceEncoder, Mode > AsShared ()
 
TSharedRef< IVoiceEncoder const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< IVoiceEncoder, Mode > AsWeak ()
 
TWeakPtr< IVoiceEncoder const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Protected Member Functions

 IVoiceEncoder ()
 
- Protected Member Functions inherited from TSharedFromThis< IVoiceEncoder >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from TSharedFromThis< IVoiceEncoder >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Detailed Description

Interface for encoding raw voice for transmission over the wire

Constructor & Destructor Documentation

◆ IVoiceEncoder()

IVoiceEncoder::IVoiceEncoder ( )
inlineprotected

◆ ~IVoiceEncoder()

virtual IVoiceEncoder::~IVoiceEncoder ( )
inlinevirtual

Member Function Documentation

◆ Destroy()

virtual void IVoiceEncoder::Destroy ( )
pure virtual

Cleanup the encoder

◆ DumpState()

virtual void IVoiceEncoder::DumpState ( ) const
pure virtual

Output the state of the encoder

◆ Encode()

virtual int32 IVoiceEncoder::Encode ( const uint8 RawPCMData,
uint32  RawDataSize,
uint8 OutCompressedData,
uint32 OutCompressedDataSize 
)
pure virtual

Encode a raw audio stream (expects 16bit PCM audio)

Parameters
RawPCMDataarray of raw PCM data to encode
RawDataSizeamount of raw PCM data in the buffer
OutCompressedDatabuffer to contain encoded/compressed audio stream
OutCompressedDataSize[in/out] amount of buffer used to encode the audio stream
Returns
number of bytes at the end of the stream that wasn't encoded (some interfaces can only encode at a certain frame slice)

◆ Init()

virtual bool IVoiceEncoder::Init ( int32  SampleRate,
int32  NumChannels,
EAudioEncodeHint  EncodeHint 
)
pure virtual

Initialize the encoder

Parameters
SampleRaterequested sample rate of the encoding
NumChannelnumber of channels in the raw audio stream
EncodeHinttype of audio that will be encoded
Returns
true if initialization was successful, false otherwise

◆ Reset()

virtual void IVoiceEncoder::Reset ( )
pure virtual

Reset the encoder back to its initial state

◆ SetBitrate()

virtual bool IVoiceEncoder::SetBitrate ( int32  InBitRate)
pure virtual

Adjust the encoding bitrate

Parameters
InBitRatenew bitrate value (bits/sec)
Returns
true if successfully changed, false otherwise

◆ SetComplexity()

virtual bool IVoiceEncoder::SetComplexity ( int32  InComplexity)
pure virtual

Adjust the encoding complexity (platform specific)

Parameters
InComplexitynew complexity
Returns
true if successfully changed, false otherwise

◆ SetVBR()

virtual bool IVoiceEncoder::SetVBR ( bool  bEnableVBR)
pure virtual

Set the encoding to variable bitrate

Parameters
bEnableVBRtrue to use variable bit rate, false to turn it off
Returns
true if successfully changed, false otherwise

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