Configure character audio

Set character voice volume, enable spatial audio, and control NPC playback through the ConvaiAudio facade for scripted mute and unmute.

The ConvaiAudioOutput component controls how a character's voice plays back in the scene. Pair it with the ConvaiAudio facade on ConvaiManager for scripted runtime control of mute state, per-character volume, and audio events.

Character audio output

Add ConvaiAudioOutput to the same GameObject as ConvaiCharacter. An AudioSource on the same GameObject is required.

Inspector fields:

Field
Default
Description

Volume

1.0

Playback volume (0–1)

IsMuted

false

Mute this character's audio output

_use3DAudio

true

Enable Unity spatial audio

_minDistance

1

Distance at which audio is at full volume

_maxDistance

50

Distance at which audio falls to zero

Disable _use3DAudio for non-positional scenarios — for example, a kiosk interface where the character always sounds "present" regardless of where the player stands.

Audio facade

For scripted audio control, use the ConvaiAudio facade accessed through ConvaiManager.Audio. This is the recommended API for runtime audio management.

Microphone control

// Mute/unmute the local microphone
ConvaiManager.ActiveManager.Audio.SetMicMuted(true);

// Toggle and get the new state
bool isMuted = ConvaiManager.ActiveManager.Audio.ToggleMicMuted();

// Start microphone capture manually (if ConnectOnStart is false)
await ConvaiManager.ActiveManager.Audio.StartListeningAsync();

Per-character playback control

Audio events

Usage examples

Example 1: Mute toggle UI button

Scenario: A corporate onboarding simulation includes a mic mute button in the corner of the screen.

Expected outcome: The toggle stays in sync with the actual microphone state. Pressing it mutes or unmutes the mic. External changes (for example, from push-to-talk logic) also update the toggle automatically.

Example 2: Per-character volume in a multi-instructor scene

Scenario: A language learning simulation has two AI instructors — a main teacher and a conversation partner. Players can independently adjust their volumes.

Expected outcome: Each character's volume slider controls only that character's AudioSource volume. The two characters can be heard at different levels independently.

Next steps

Configure the microphone device and platform-specific audio permissions.

Configure microphone

Last updated

Was this helpful?