class

IVoiceCodec

Module
VoiceChat
Header
#include "VoiceChat/IVoiceCodec.h"
Namespace
Mowo

Constructors

SignatureNameDescription
virtual ~IVoiceCodec() = default~IVoiceCodec

Public functions

ReturnsNameDescription
EVoiceCodecIdGetCodecId
const char*GetName
uint32_tGetSampleRate
uint32_tGetFrameSamples
std::unique_ptr<IVoiceDecoder>CreateDecoderA fresh per-stream decoder.
uint32_tGetMaxEncodedBytesUpper bound on the encoded size of one frame.
boolEncodeFrameEncodes exactly GetFrameSamples() samples into out (cleared first, never grown past GetMaxEncodedBytes).
boolDecodeFrameDecodes one payload back into exactly GetFrameSamples() samples.
boolSupportsInbandFecTrue when the codec embeds a coarse copy of the previous frame in every payload, so one lost frame can be rebuilt from its successor instead of concealed.
boolDecodeFecFrameReconstructs the frame that PRECEDES nextPacket out of the redundancy inside it, and must run before nextPacket itself is decoded — the decoder walks the two in order.

Function details

~IVoiceCodec

C++
virtual ~IVoiceCodec() = default

GetCodecId

C++
virtual EVoiceCodecId GetCodecId() const = 0

GetName

C++
virtual const char* GetName() const = 0

GetSampleRate

C++
virtual uint32_t GetSampleRate() const = 0

GetFrameSamples

C++
virtual uint32_t GetFrameSamples() const = 0

CreateDecoder

C++
virtual std::unique_ptr<IVoiceDecoder> CreateDecoder() const = 0

A fresh per-stream decoder. Never shared between speakers.

GetMaxEncodedBytes

C++
virtual uint32_t GetMaxEncodedBytes() const = 0

Upper bound on the encoded size of one frame. Callers reserve against this once so the steady state never reallocates.

EncodeFrame

C++
virtual bool EncodeFrame(const int16_t* samples, uint32_t sampleCount, std::vector<uint8_t>& out) = 0

Encodes exactly GetFrameSamples() samples into out (cleared first, never grown past GetMaxEncodedBytes). False on a wrong sample count.

DecodeFrame

C++
virtual bool DecodeFrame(const uint8_t* data, size_t len, std::vector<int16_t>& out) = 0

Decodes one payload back into exactly GetFrameSamples() samples. False on a truncated or malformed payload — a hostile peer must not be able to talk the decoder into writing an unbounded block.

SupportsInbandFec

C++
virtual bool SupportsInbandFec() const

True when the codec embeds a coarse copy of the previous frame in every payload, so one lost frame can be rebuilt from its successor instead of concealed.

DecodeFecFrame

C++
virtual bool DecodeFecFrame(const uint8_t*, size_t, std::vector<int16_t>&)

Reconstructs the frame that PRECEDES nextPacket out of the redundancy inside it, and must run before nextPacket itself is decoded — the decoder walks the two in order. False when the codec carries no redundancy, or this packet happens to carry none.

Generated from VoiceChat/IVoiceCodec.h via voicechat.json · Oct 26, 2026Version 1.0.0