class

FVoiceFragmentBuffer

FVoiceFragmentBuffer — short clips of what other players actually said, for a creature that answers in their voices. It keeps utterances, not a stream: a run of voiced frames becomes one fragment when the talker pauses, a run too short to be a word is thrown away, and each player keeps only their last few.

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

What it promises, because this is the one place voice is kept at all: - memory only: nothing here writes, logs or uploads a sample; - only from a talker whose own client stamped consent on the frame — a frame without it drops everything held for that talker at once; - never from a muted talker, and never while the listener is deafened (FVoiceChatSystem gates both before a frame gets here); - gone with the session: Shutdown, a peer leaving and a mute all forget.

Properties

TypeNameDescription
static constexpr floatkVoicedRmsA frame quieter than this RMS (of full scale) counts as a pause. Default 0.01f.

Public functions

ReturnsNameDescription
voidConfigure
voidPushFrameOne playout frame of a talker.
voidForgetPeer
voidClear
uint32_tGetFragmentCount
uint32_tGetTotalFragmentCount
uint64_tGetHeldSamples
boolTakeNewestFragmentHands the newest finished fragment over and removes it, so the same clip is not replayed until the talker says something new.
uint32_tGetSampleRate

Function details

Configure

C++
void Configure(uint32_t sampleRate, float minFragmentSeconds = 0.4f, float maxFragmentSeconds = 3.0f, uint32_t maxFragmentsPerPeer = 6)

PushFrame

C++
void PushFrame(uint32_t peerId, const int16_t* samples, uint32_t count, bool realFrame)

One playout frame of a talker. realFrame is false for concealment and silence the jitter buffer made up; those end an utterance.

ForgetPeer

C++
void ForgetPeer(uint32_t peerId)

Clear

C++
void Clear()

GetFragmentCount

C++
uint32_t GetFragmentCount(uint32_t peerId) const

GetTotalFragmentCount

C++
uint32_t GetTotalFragmentCount() const

GetHeldSamples

C++
uint64_t GetHeldSamples() const

TakeNewestFragment

C++
bool TakeNewestFragment(uint32_t peerId, std::vector<int16_t>& out)

Hands the newest finished fragment over and removes it, so the same clip is not replayed until the talker says something new.

GetSampleRate

C++
uint32_t GetSampleRate() const
Generated from VoiceChat/FVoiceFragmentBuffer.h via voicechat.json · Oct 26, 2026Version 1.0.0