IVoiceDecoder
One speaker's decoding state. A stateful codec (Opus predicts each frame from the ones before it) needs a decoder per stream: a single decoder fed several speakers interleaved predicts every frame from someone else's voice, which degrades audibly from the third player on and leaves loss recovery with nothing coherent to recover from. Frames must reach it in sequence order, which is why the jitter buffer holds packets and decodes at playout.
- Module
- VoiceChat
- Header
#include "VoiceChat/IVoiceCodec.h"- Namespace
Mowo
Constructors
| Signature | Name | Description |
|---|---|---|
virtual ~IVoiceDecoder() = default | ~IVoiceDecoder |
Public functions
| Returns | Name | Description |
|---|---|---|
bool | Decode | Decodes one payload into exactly the codec's frame size. |
bool | DecodeFec | Rebuilds the frame immediately BEFORE nextPacket from its inband FEC. |
bool | DecodeRedundancy | Rebuilds the frame framesBack frames before packet from its deep redundancy (Opus DRED). |
bool | Conceal | Synthesises a frame for a hole nothing covers (packet-loss concealment that continues the decoder's own signal). |
Function details
~IVoiceDecoder
virtual ~IVoiceDecoder() = defaultDecode
virtual bool Decode(const uint8_t* data, size_t len, std::vector<int16_t>& out) = 0Decodes one payload into exactly the codec's frame size.
DecodeFec
virtual bool DecodeFec(const uint8_t* nextPacket, size_t len, std::vector<int16_t>& out)Rebuilds the frame immediately BEFORE nextPacket from its inband FEC.
DecodeRedundancy
virtual bool DecodeRedundancy(const uint8_t* packet, size_t len, uint32_t framesBack, std::vector<int16_t>& out)Rebuilds the frame framesBack frames before packet from its deep redundancy (Opus DRED). False when the packet carries none, or not that far back.
Conceal
virtual bool Conceal(std::vector<int16_t>& out)Synthesises a frame for a hole nothing covers (packet-loss concealment that continues the decoder's own signal). False when the codec has none and the caller should fall back to its own concealment.