> ## Documentation Index
> Fetch the complete documentation index at: https://docs.discord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing Voice Chat

> Integrate Discord voice chat features into your application.

export const VoiceNormalIcon = props => <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path fill="currentColor" d="M12 3a1 1 0 0 0-1-1h-.06a1 1 0 0 0-.74.32L5.92 7H3a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h2.92l4.28 4.68a1 1 0 0 0 .74.32H11a1 1 0 0 0 1-1V3ZM15.1 20.75c-.58.14-1.1-.33-1.1-.92v-.03c0-.5.37-.92.85-1.05a7 7 0 0 0 0-13.5A1.11 1.11 0 0 1 14 4.2v-.03c0-.6.52-1.06 1.1-.92a9 9 0 0 1 0 17.5Z" /><path fill="currentColor" d="M15.16 16.51c-.57.28-1.16-.2-1.16-.83v-.14c0-.43.28-.8.63-1.02a3 3 0 0 0 0-5.04c-.35-.23-.63-.6-.63-1.02v-.14c0-.63.59-1.1 1.16-.83a5 5 0 0 1 0 9.02Z" /></svg>;

export const ClydeIcon = props => <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path fill="currentColor" d="M19.73 4.87a18.2 18.2 0 0 0-4.6-1.44c-.21.4-.4.8-.58 1.21-1.69-.25-3.4-.25-5.1 0-.18-.41-.37-.82-.59-1.2-1.6.27-3.14.75-4.6 1.43A19.04 19.04 0 0 0 .96 17.7a18.43 18.43 0 0 0 5.63 2.87c.46-.62.86-1.28 1.2-1.98-.65-.25-1.29-.55-1.9-.92.17-.12.32-.24.47-.37 3.58 1.7 7.7 1.7 11.28 0l.46.37c-.6.36-1.25.67-1.9.92.35.7.75 1.35 1.2 1.98 2.03-.63 3.94-1.6 5.64-2.87.47-4.87-.78-9.09-3.3-12.83ZM8.3 15.12c-1.1 0-2-1.02-2-2.27 0-1.24.88-2.26 2-2.26s2.02 1.02 2 2.26c0 1.25-.89 2.27-2 2.27Zm7.4 0c-1.1 0-2-1.02-2-2.27 0-1.24.88-2.26 2-2.26s2.02 1.02 2 2.26c0 1.25-.88 2.27-2 2.27Z" /></svg>;

export const MagicWandIcon = props => <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none"><path fill="currentColor" d="M18.48 13.39a.56.56 0 0 1 1.04 0l.84 2.25 2.25.84c.48.18.48.86 0 1.04l-2.25.84-.84 2.25a.56.56 0 0 1-1.04 0l-.84-2.25-2.25-.84a.56.56 0 0 1 0-1.04l2.25-.84.84-2.25Zm-4.4-5.63c.26-.26.73-.2 1.06.13l1.53 1.53c.33.33.39.8.13 1.06L6.73 20.55c-.26.26-.73.2-1.06-.13L4.14 18.9c-.33-.33-.39-.8-.13-1.05L14.09 7.76Zm3.68-3.88c.26-.25.73-.2 1.05.13l1.54 1.54c.33.33.38.8.13 1.05L18.4 8.68c-.25.25-.72.2-1.05-.13L15.81 7c-.32-.32-.38-.8-.13-1.05l2.08-2.08ZM9.53 1.25a.5.5 0 0 1 .94 0l.62 1.66 1.66.62a.5.5 0 0 1 0 .94l-1.66.62-.62 1.66a.5.5 0 0 1-.94 0L8.91 5.1l-1.66-.62a.5.5 0 0 1 0-.94l1.66-.62.62-1.66Z" /><path fill="currentColor" d="M18.48 13.39a.56.56 0 0 1 1.04 0l.84 2.25 2.25.84c.48.18.48.86 0 1.04l-2.25.84-.84 2.25a.56.56 0 0 1-1.04 0l-.84-2.25-2.25-.84a.56.56 0 0 1 0-1.04l2.25-.84.84-2.25ZM14.09 7.76c.25-.26.72-.2 1.05.13l1.53 1.53c.33.33.39.8.13 1.06L6.73 20.55c-.26.26-.73.2-1.06-.13L4.14 18.9c-.33-.33-.39-.8-.13-1.05L14.09 7.76ZM17.76 3.88c.26-.25.73-.2 1.05.13l1.54 1.54c.33.33.38.8.13 1.05L18.4 8.68c-.25.25-.72.2-1.05-.13L15.8 7c-.32-.32-.38-.8-.13-1.05l2.08-2.08ZM9.53 1.25a.5.5 0 0 1 .94 0l.62 1.66 1.66.62a.5.5 0 0 1 0 .94l-1.66.62-.62 1.66a.5.5 0 0 1-.94 0L8.91 5.1l-1.66-.62a.5.5 0 0 1 0-.94l1.66-.62.62-1.66Z" /></svg>;

<Warning>
  This feature is currently available with rate limits.
  To increase the rate limits for your game, please follow
  [Communication Features: Applying for Increased Rate Limits for Production Releases](/developers/discord-social-sdk/core-concepts/communication-features#applying-for-increased-rate-limits-for-production-releases).
</Warning>

## Overview

Voice calls are a core feature of the Discord Social SDK that enable real-time voice communication between players in your game within lobbies.

This guide will show you how to:

* Start and join voice calls in lobbies
* Control voice settings like mute, deafen, and volume
* Process audio data with custom callbacks
* Integrate with external audio systems
* Check voice call status and participant states

## Prerequisites

Before you can start a voice call, you must complete these essential steps:

<Warning>
  To utilize this communication feature, you must enable [`Client::GetDefaultCommunicationScopes`] in your OAuth Scope configuration.
  See the [OAuth Scopes Core Concepts Guide](/developers/discord-social-sdk/core-concepts/oauth2-scopes) for more details.
</Warning>

[`Client::GetDefaultCommunicationScopes`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a71499da752fbdc2d4326ae0fd36c0dd1

### 1. Lobby Management

**Voice calls require an active lobby with participants.** You must:

1. **Create or join a lobby** using the Discord Social SDK
2. **Add players to the lobby** - voice calls only work with lobby members

<Info>
  Essential Reading: For detailed instructions on creating lobbies, joining lobbies, and managing lobby members, see
  the complete [Managing Lobbies Guide](/developers/discord-social-sdk/development-guides/managing-lobbies).
</Info>

### 2. Lobby Size Limitations

While Discord lobbies technically support up to 1,000 members, **voice calls should be limited to much smaller groups**. We **strongly recommend keeping voice calls to 25 members or fewer** for optimal performance and user experience.

***

## Starting and Joining Voice Calls

The Discord Social SDK makes it simple to start and join voice calls - both operations use the same functions whether you're creating something new or joining something that already exists.

### Creating/Joining a Lobby and Starting/Joining a Call

Here's a complete example of joining a lobby and starting a voice call:

```cpp theme={"system"}
// First, create or join a lobby using a shared secret
const std::string lobbySecret = "my-game-lobby-secret";

client->CreateOrJoinLobby(lobbySecret, [client](const discordpp::ClientResult& result, uint64_t lobbyId) {
    if (result.Successful()) {
        std::cout << "🎮 Successfully joined lobby!" << std::endl;

        // Now start or join the voice call in this lobby
        // StartCall returns a Call object but has no callback
        const auto call = client->StartCall(lobbyId);

        // StartCall returns null if user is already in this voice channel
        if (call) {
          std::cout << "🎤 Voice call operation initiated..." << std::endl;
        } else {
          std::cout << "ℹ️ Already in this voice channel" << std::endl;
        }

    } else {
        std::cerr << "❌ Failed to join lobby: " << result.Error() << std::endl;
    }
});
```

### How It Works

Both [`Client::CreateOrJoinLobby`] and [`Client::StartCall`] are designed to handle existing and new scenarios automatically:

* [`Client::CreateOrJoinLobby`]: If a lobby with the given secret already exists, you'll join it. If not, a new
  lobby is created with that secret.
* [`Client::StartCall`]: If a voice call is already active in the lobby, you'll join it. If not, a new voice call is
  started.

<Info>
  You don't need to check if a lobby exists or if a call is already ongoing. The SDK handles both scenarios seamlessly, making your code simpler and more reliable.
</Info>

## Controlling Voice Features

The Discord Social SDK provides comprehensive voice control options at both the individual call level and globally across all calls.

### Global Voice Controls

These methods control voice settings across all active calls using the [`Client`] object:

* [`Client::SetSelfMuteAll`] - Mutes your microphone across all active calls
* [`Client::SetSelfDeafAll`] - Deafens you across all active calls
* [`Client::SetInputVolume`] - Sets microphone volume
* [`Client::SetOutputVolume`] - Sets speaker volume

### Per-Call Voice Controls

These methods control voice settings for a specific call using the [`Call`] object:

* [`Call::SetSelfMute`] - Mutes your microphone so other participants in this call cannot hear you
* [`Call::SetSelfDeaf`] - Mutes all audio from this call so you cannot hear other participants, and they cannot hear you either
* [`Call::SetParticipantVolume`] - Adjusts the volume of a specific participant

### Voice Activity Detection

Use [`Call::SetVADThreshold`] to control voice activation detection sensitivity. This allows optional fine-tuning of
when the system considers someone to be speaking.

```cpp theme={"system"}
// Per-call controls (assuming you have a Call object)
uint64_t lobbyId = 123456789;  // Your lobby ID
auto call = client->GetCall(lobbyId);
if (call) {
    call.SetSelfMute(true);           // Mute in this call only
    call.SetSelfDeaf(false);          // Unmute audio in this call
    call.SetParticipantVolume(userId, 150.0f);  // Increase participant volume
    call.SetVADThreshold(false, -30.0f);       // Set custom voice detection threshold
}

// Global controls
client->SetSelfMuteAll(true);          // Mute across all calls
client->SetInputVolume(75.0f);         // Set microphone to 75%
client->SetOutputVolume(120.0f);       // Increase speaker volume to 120%
```

### Detecting No Audio Input

The SDK can notify you when no audio is reaching the microphone — for example, when a user's mic is broken, muted at the OS level, or the wrong input device is selected. This lets your game surface a "your mic appears silent" hint instead of leaving the user to wonder why nobody can hear them.

* [`Client::SetNoAudioInputThreshold`] — dBFS threshold for what counts as "no input." Range `[-100.0, 100.0]`, defaults to `-100.0` (detection disabled). Set to something like `-60.0` to enable.
* [`Client::SetNoAudioInputCallback`] — receives a `bool inputDetected` whenever the mic crosses the threshold (silent → active or active → silent).

```cpp theme={"system"}
// Enable detection at -60 dBFS
client->SetNoAudioInputThreshold(-60.0f);

client->SetNoAudioInputCallback([](bool inputDetected) {
    if (!inputDetected) {
        // Show a UI hint: "Your mic appears silent — check your device settings."
    } else {
        // Mic is receiving audio again; clear the hint.
    }
});
```

## Noise Suppression & Cancellation

The SDK provides two tiers of microphone audio processing: a set of WebRTC-based defaults that are always on, and an optional Krisp-powered noise cancellation for higher-quality results.

<Info>
  Krisp delivers higher-quality noise cancellation, but ships extra libraries and model files that increase your installation size. If size is a constraint — for example on mobile — see [Excluding Krisp to Reduce Installation Size](#excluding-krisp-to-reduce-installation-size) for how to ship with only the WebRTC defaults.
</Info>

### Default Audio Processing (WebRTC)

These three processors ship with every build and default to on. They use the WebRTC library's standard audio pipeline:

* [`Client::SetNoiseSuppression`] — suppresses steady background noise (e.g. fans, keyboards, room tone). Defaults
  to on.
* [`Client::SetEchoCancellation`] — removes echo from speakers being picked up by the mic. Defaults to on.
* [`Client::SetAutomaticGainControl`] — automatically normalizes microphone volume for clarity and consistency. Defaults to on.

```cpp theme={"system"}
// Toggle individual WebRTC processors from a voice settings UI
client->SetNoiseSuppression(true);
client->SetEchoCancellation(true);
client->SetAutomaticGainControl(true);
```

### Advanced Noise Cancellation (Krisp)

[`Client::SetNoiseCancellation`] enables Krisp, a noise cancellation technology that removes a much wider range of
background sounds (e.g. typing, dogs barking, traffic) than the WebRTC suppression. It defaults to off.

<Tip>
  Krisp and WebRTC noise suppression are mutually exclusive. Enabling [`Client::SetNoiseCancellation`] automatically disables [`Client::SetNoiseSuppression`] — you don't need to turn it off yourself.
</Tip>

```cpp theme={"system"}
// Enable Krisp noise cancellation
client->SetNoiseCancellation(true);
```

### Excluding Krisp to Reduce Installation Size

Krisp ships as additional libraries and model files alongside the core SDK, which adds to your installation size. If you're optimizing for size — for example on mobile — you can ship without Krisp and rely on the WebRTC noise suppression instead.

To exclude Krisp from your distribution, remove all `.kef` and `.kw` files along with any file or directory whose name
contains `krisp` (for example `discord_krisp.dll`, `libdiscord_krisp.dylib`, `discord_partner_sdk_krisp.aar`, and `discord_partner_sdk_krisp.xcframework`).

## Advanced Audio Processing

### Manipulating Voice Data with Callbacks

For advanced audio processing needs, use [`Client::StartCallWithAudioCallbacks`] to access raw audio data. This
enables real-time audio manipulation and integration with external audio processing systems.

### In-Place Audio Modification

To directly modify incoming audio samples (e.g., volume dampening):

```cpp theme={"system"}
const auto call = client->StartCallWithAudioCallbacks(
    lobbyId,
    [](uint64_t userId, int16_t *data, const size_t samplesPerChannel,
       int sampleRate, const size_t channels,
       bool &outShouldMuteData) {
      // Dampen volume of incoming audio by modifying data's samples
      // in-place
      for (int i = 0; i < samplesPerChannel * channels; i++) {
        data[i] *= 0.5; // Reduce volume by 50%
      }
    },
    [](int16_t *data, uint64_t samplesPerChannel, int32_t sampleRate,
       uint64_t channels) {});

```

### External Audio Pipeline Integration

To route audio to external processing systems such as [FMOD](https://www.fmod.com/) or
[Wwise](https://www.audiokinetic.com/en/wwise/overview/):

```cpp theme={"system"}
const auto call = client->StartCallWithAudioCallbacks(lobbyId,
    [](uint64_t userId, int16_t* data, size_t samplesPerChannel,
       int sampleRate, size_t channels, bool& outShouldMuteData) {
        // Prevent Discord from playing the audio directly
        outShouldMuteData = true;

        const int totalNumSamples = samplesPerChannel * channels;
        // Send audio data to your external audio system
        SendAudioToExternalAudioSystem(data, totalNumSamples);
    },
    [](int16_t *data, uint64_t samplesPerChannel, int32_t sampleRate,
       uint64_t channels) {});
```

### Key Audio Processing Points

1. **Direct Manipulation**: The `data` parameter in `Client::UserAudioReceivedCallback` can be modified in-place to alter incoming audio samples
2. **External Processing**: Set `outShouldMuteData = true` to prevent Discord from playing audio directly, allowing you to handle it through your own audio pipeline
3. **No Encoding Required**: The SDK handles all voice encoding/decoding automatically - you work with raw audio samples

## Ending Voice Calls

When you need to terminate voice calls, you have two options:

### End a Call For a Specific Lobby

```cpp theme={"system"}
uint64_t lobbyId = 123456789;  // Your lobby ID
client->EndCall(lobbyId, []() {
    std::cout << "🔇 Call ended successfully" << std::endl;
});
```

### End All Calls

```cpp theme={"system"}
client->EndCalls([]() {
    std::cout << "🔇 All calls ended successfully" << std::endl;
});
```

## Checking Lobby Voice Call Status

You may want to check the voice call status for your lobby to display UI indicators, monitor participant activity, or provide information to players. The Discord Social SDK provides several ways to inspect active voice calls and participant states.

### Checking if a Call is Active

Use `LobbyHandle::GetCallInfoHandle()` to determine if there's an active voice call in your lobby:

```cpp theme={"system"}
// Check if there's an active call in the lobby
const auto callInfoHandle = lobby->GetCallInfoHandle();
if (callInfoHandle) {
  // There's an active call - you can join it or get participant
  // info
  const auto participants = callInfoHandle->GetParticipants();
  std::cout << "Active call with " << participants.size()
            << " participants" << std::endl;
} else {
  // No active call in this lobby
  std::cout << "No active voice call in this lobby" << std::endl;
}

```

### Checking Individual Participant Status

For each participant in a voice call, you can check their voice state using `VoiceStateHandle`:

```cpp theme={"system"}
// Get voice state information for participants
const auto callInfo = lobby->GetCallInfoHandle();
if (callInfo) {
  const auto participants = callInfo->GetParticipants();

  for (const auto &participantId : participants) {
    const auto voiceState = callInfo->GetVoiceStateHandle(participantId);
    if (voiceState) {
      const bool isMuted = voiceState->SelfMute();
      const bool isDeafened = voiceState->SelfDeaf();

      std::cout << "Participant " << participantId
                << " - Muted: " << (isMuted ? "Yes" : "No")
                << ", Deafened: " << (isDeafened ? "Yes" : "No")
                << std::endl;
    }
  }
}

```

### Voice State Information Available

The [`VoiceStateHandle`] provides these key details about each participant:

* [`VoiceStateHandle::SelfMute`]: Returns `true` if the user has muted themselves (others cannot hear them)
* [`VoiceStateHandle::SelfDeaf`]: Returns `true` if the user has deafened themselves (they cannot hear others and others cannot hear them)

This information is particularly useful for:

* Displaying voice indicators in your UI
* Implementing voice-related features or debugging audio issues

***

## Diagnosing Audio Issues

If users report echo, feedback, or other audio quality problems, the SDK offers dedicated tooling for capturing voice and audio diagnostics. See the following sections of the Debug & Log guide:

* [Voice Logging](/developers/discord-social-sdk/how-to/debug-log#voice-logging) — capture logs from the voice subsystem and underlying WebRTC layer.
* [Audio Logging](/developers/discord-social-sdk/how-to/debug-log#audio-logging) — record input/output waveforms to disk for offline analysis.

***

## Next Steps

<CardGroup cols={3}>
  <Card title="Integrate Moderation" href="/developers/discord-social-sdk/how-to/integrate-moderation" icon={<MagicWandIcon />}>
    Integrating and managing content moderation for your game when using the Discord Social SDK.
  </Card>

  <Card title="Use with Discord APIs" href="/developers/discord-social-sdk/how-to/use-with-discord-apis" icon={<ClydeIcon />}>
    Make requests to Discord's HTTP APIs from your game.
  </Card>

  <Card title="Voice Muting Based on Player Blocks" href="/developers/discord-social-sdk/how-to/voice-muting-for-blocked-players" icon={<VoiceNormalIcon />}>
    Mute players in lobby voice calls based on block relationships.
  </Card>
</CardGroup>

Need help? Join the [Discord Developers Server](https://discord.gg/discord-developers) and share questions in the `#social-sdk-dev-help` channel for support from the community.

If you encounter a bug while working with the Social SDK, please report it here:  [https://dis.gd/social-sdk-bug-report](https://dis.gd/social-sdk-bug-report)

***

## Change Log

| Date           | Changes                                                           |
| -------------- | ----------------------------------------------------------------- |
| May 13, 2026   | Add noise suppression, cancellation, and no-audio-input detection |
| June 30, 2025  | Add communications scope warning                                  |
| June 19, 2025  | released guide                                                    |
| March 17, 2025 | initial release                                                   |

[`Call`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#a1cc8a7f73c15a960bc409d734b5edbd1

[`Call::SetParticipantVolume`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#ad974fadbe89c453e4d8a3f9824e21ceb

[`Call::SetSelfDeaf`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#a07d67c210f2a4655c6f1d2899c6d32d6

[`Call::SetSelfMute`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#afa35a5d6a4564df97452df58bb74f617

[`Call::SetVADThreshold`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#a7c3fd83c5dfe37d796e30c5e28c93b6e

[`Client`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a91716140c699d8ef0bdf6bfd7ee0ae13

[`Client::CreateOrJoinLobby`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a8b4e195555ecaa89ccdfc0acd28d3512

[`Client::SetAutomaticGainControl`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a818ae7f46b5bd3873dcd51dd3d9fa64d

[`Client::SetEchoCancellation`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a1def244b7ecd388902ba5256ce506ca3

[`Client::SetInputVolume`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ad4358f5baffd9a5f2a6fa74d62459313

[`Client::SetNoAudioInputCallback`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a479e60724bf6b0b39b555c1ff8489b9e

[`Client::SetNoAudioInputThreshold`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ab33f5d70461ee7590b6f3cfccaeb6df4

[`Client::SetNoiseCancellation`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a54aad09e8e06dc327695209b733d3f4c

[`Client::SetNoiseSuppression`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ae3f6e33b956964525adfa4536bd1fe73

[`Client::SetOutputVolume`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a61a9321a79479c8b1be1559e2bbdd934

[`Client::SetSelfDeafAll`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a59be56ae5752e9f2f0f299bc552282b2

[`Client::SetSelfMuteAll`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a9c6ef96590533d103a866cb8a99d2669

[`Client::StartCall`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#aef4f25d761fe198fbe9bc721fc24d83f

[`Client::StartCallWithAudioCallbacks`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#abcaa891769f9e912bfa0e06ff7221b05

[`VoiceStateHandle`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1VoiceStateHandle.html#aad2d4454b6677d82721128b0cd98a2d8

[`VoiceStateHandle::SelfDeaf`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1VoiceStateHandle.html#a9fd4ac5fb813b926d1336fc65b440f42

[`VoiceStateHandle::SelfMute`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1VoiceStateHandle.html#a5476a6e8d5e9092a153b4646371a9f3f
