Docs/Voice

Voice

Stream captured audio to an NPC and play back its spoken reply.

Voice runs over the same connection as text. The plugin gives you the wire methods — streaming audio chunks in, receiving synthesized speech back — but capturing the player's microphone and deciding when they've stopped talking is up to you, using Unreal's own audio capture systems.

No built-in microphone capture or voice detection
The plugin does not capture your microphone or run voice-activity detection for you. This is a real gap today, not a hidden limitation: you own capture (Unreal's AudioCapture / SubmixListener APIs are the usual approach) and pass the plugin raw PCM bytes.

Sending audio

Stream chunks as you capture them, then send one final chunk with bEnd = true — or let the server auto-finalize once it has buffered about 5MB, whichever comes first:

MyGameMode.cpp
// PcmChunk: TArray<uint8> of raw audio you've already captured
Connection->SendVoiceChunk(PcmChunk, false);

// ...more chunks as they're captured...

Connection->SendVoiceChunk(FinalChunk, true); // bEnd: true
Data
Raw PCM bytes for this chunk, as a TArray<uint8>. The plugin base64-encodes it for the wire.
bEnd
Set true on the final chunk of the utterance.
SenderId
Optional. Overrides the connection's default player id for this utterance.

Once the server finishes transcribing, an OnTranscript delegate fires with what it heard, followed by the normal chat delegates — voice replies arrive as one complete OnChatChunk rather than streamed token by token, since grounding runs before anything is sent back.

Playing the reply

Synthesized speech arrives as raw binary WebSocket frames — no JSON envelope, delivered per sentence, in playback order:

MyGameMode.cpp
Connection->OnAudio.AddDynamic(this, &AMyGameMode::OnAudio);

UFUNCTION()
void AMyGameMode::OnAudio(const TArray<uint8>& Bytes)
{
    // Raw synthesized speech for one sentence. Decode/queue it with
    // your own USoundWaveProcedural playback pipeline.
    PlayAudioChunk(Bytes);
}
Microphone permission
Requesting microphone access has its own platform-specific flow (desktop generally works out of the box; mobile and console platforms each have their own permission prompt). Request access before the first voice interaction, and offer a text fallback — text and voice can be used freely in the same connection, including in the same conversation.