From 7fd0d189fd4ed7dcff556d414060a92fbab8ab36 Mon Sep 17 00:00:00 2001 From: Mark Mandel Date: Wed, 13 May 2026 20:37:25 +0000 Subject: [PATCH 1/2] Document noise suppression, cancellation, and no-audio-input detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds three new sections to the Managing Voice Chat guide covering audio processing capabilities exposed by the Social SDK Client: - "Detecting No Audio Input" — Client::SetNoAudioInputThreshold and SetNoAudioInputCallback for surfacing "your mic appears silent" UX. - "Noise Suppression & Cancellation" — splits the WebRTC defaults (SetNoiseSuppression, SetEchoCancellation, SetAutomaticGainControl) from the optional Krisp-powered SetNoiseCancellation, and includes guidance on excluding Krisp to reduce installation size. - "Diagnosing Audio Issues" — links to the Voice Logging and Audio Logging sections of the Debug & Log guide. Also updates social-sdk-mappings.json with SetNoiseCancellation and fixes reference-link ordering in two adjacent how-to guides. --- .../managing-voice-chat.mdx | 90 +++++++++++++++++-- .../how-to/handle-rate-limits.mdx | 2 +- .../voice-muting-for-blocked-players.mdx | 12 +-- tools/doxygen/social-sdk-mappings.json | 1 + 4 files changed, 88 insertions(+), 17 deletions(-) diff --git a/developers/discord-social-sdk/development-guides/managing-voice-chat.mdx b/developers/discord-social-sdk/development-guides/managing-voice-chat.mdx index ce07475de2..1fbe8395bc 100644 --- a/developers/discord-social-sdk/development-guides/managing-voice-chat.mdx +++ b/developers/discord-social-sdk/development-guides/managing-voice-chat.mdx @@ -134,6 +134,70 @@ 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 +// 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. + + +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. + + +### 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 +// 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. + + +Krisp and WebRTC noise suppression are mutually exclusive. Enabling [`Client::SetNoiseCancellation`] automatically disables [`Client::SetNoiseSuppression`] — you don't need to turn it off yourself. + + +```cpp +// 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` 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 @@ -273,6 +337,15 @@ This information is particularly useful for: --- +## 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 import {MagicWandIcon} from '/snippets/icons/MagicWandIcon.jsx' @@ -300,11 +373,12 @@ import {VoiceNormalIcon} from '/snippets/icons/VoiceNormalIcon.jsx' ## Change Log -| Date | Changes | -|----------------|----------------------------------| -| June 30, 2025 | Add communications scope warning | -| June 19, 2025 | released guide | -| March 17, 2025 | initial release | +| 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 | {/* Autogenerated Reference Links */} [`Call`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#a1cc8a7f73c15a960bc409d734b5edbd1 @@ -314,7 +388,13 @@ import {VoiceNormalIcon} from '/snippets/icons/VoiceNormalIcon.jsx' [`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 diff --git a/developers/discord-social-sdk/how-to/handle-rate-limits.mdx b/developers/discord-social-sdk/how-to/handle-rate-limits.mdx index d41b391c78..7168809def 100644 --- a/developers/discord-social-sdk/how-to/handle-rate-limits.mdx +++ b/developers/discord-social-sdk/how-to/handle-rate-limits.mdx @@ -112,6 +112,6 @@ import {BugIcon} from '/snippets/icons/BugIcon.jsx' {/* Autogenerated Reference Links */} [`ClientResult`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ClientResult.html#a685015ca8d29a50d47fd1ed5d469ac2e -[`ClientResult::Successful`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ClientResult.html#aef3b1aca3cd156daf488ca13ae87313b [`ClientResult::Retryable`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ClientResult.html#a0d220638f4a36c0b8b731f601e0ac02d [`ClientResult::RetryAfter`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ClientResult.html#ac739adca52b90d6b4cbed5753c30fd65 +[`ClientResult::Successful`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1ClientResult.html#aef3b1aca3cd156daf488ca13ae87313b \ No newline at end of file diff --git a/developers/discord-social-sdk/how-to/voice-muting-for-blocked-players.mdx b/developers/discord-social-sdk/how-to/voice-muting-for-blocked-players.mdx index dd99c5ca1e..6520fdaf4f 100644 --- a/developers/discord-social-sdk/how-to/voice-muting-for-blocked-players.mdx +++ b/developers/discord-social-sdk/how-to/voice-muting-for-blocked-players.mdx @@ -290,14 +290,4 @@ import {ListViewIcon} from '/snippets/icons/ListViewIcon.jsx' [`Call::SetLocalMute`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#aaf8e7728b15da5d1be8d8b4258225171 [`Call::SetParticipantChangedCallback`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Call.html#acb20d338a04abec2369217f41c22c0e5 [`Client::BlockUser`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#add4a917c8382e411d5a55737c9edc8ad -[`Client::CreateOrJoinLobbyWithMetadata`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a5c84fa76c73cf3c0bfd68794ca5595c1 -[`Client::GetCurrentUserV2`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ae52259570ba657252d91f5580636fe5d -[`Client::GetLobbyHandle`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#aee1d8d43efe5caa2d97b64ab699e5854 -[`Client::GetRelationships`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ad481849835cd570f0e03adafcf90125d -[`Client::StartCall`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#aef4f25d761fe198fbe9bc721fc24d83f -[`LobbyHandle::GetLobbyMemberHandle`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1LobbyHandle.html#a9e64cab5c6cfbf7477c6d868a3b47c0d -[`LobbyHandle::LobbyMemberIds`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1LobbyHandle.html#acf329ee87e0f2f9f14b61adbd931b9c7 -[`LobbyMemberHandle::Metadata`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1LobbyMemberHandle.html#ade3709e5e5f44f53428b386924416f6b -[`RelationshipHandle::DiscordRelationshipType`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1RelationshipHandle.html#a5fecfb79a4a2b6f3dc5f73b09d0c3881 -[`RelationshipHandle::Id`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1RelationshipHandle.html#a3a14b6cfa9a9fffc61e500d8329be587 -[`RelationshipType`]: https://discord.com/developers/docs/social-sdk/namespacediscordpp.html#a28fc5199b9211c24124c06f30c1d0cbb +[`Client::CreateOrJoinLobbyWithMetadata`]: https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a5c84fa76c73cf3c0bfd68794ca5595c1 \ No newline at end of file diff --git a/tools/doxygen/social-sdk-mappings.json b/tools/doxygen/social-sdk-mappings.json index 72c5701bdc..cf75bcd6c4 100644 --- a/tools/doxygen/social-sdk-mappings.json +++ b/tools/doxygen/social-sdk-mappings.json @@ -220,6 +220,7 @@ "discordpp::Client::SetInputVolume": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ad4358f5baffd9a5f2a6fa74d62459313", "discordpp::Client::SetNoAudioInputCallback": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a479e60724bf6b0b39b555c1ff8489b9e", "discordpp::Client::SetNoAudioInputThreshold": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ab33f5d70461ee7590b6f3cfccaeb6df4", + "discordpp::Client::SetNoiseCancellation": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a54aad09e8e06dc327695209b733d3f4c", "discordpp::Client::SetNoiseSuppression": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#ae3f6e33b956964525adfa4536bd1fe73", "discordpp::Client::SetOpusHardwareCoding": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#a50f3315b3c13ad6e543b60981976fe33", "discordpp::Client::SetOutputDevice": "https://discord.com/developers/docs/social-sdk/classdiscordpp_1_1Client.html#aa06fdf131c2105cd06fb79592624678e", From a0ed07a485e5a581cfc42e520c34ad6a1839be25 Mon Sep 17 00:00:00 2001 From: Mark Mandel Date: Wed, 13 May 2026 21:05:18 +0000 Subject: [PATCH 2/2] Review updates --- .../development-guides/managing-voice-chat.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/developers/discord-social-sdk/development-guides/managing-voice-chat.mdx b/developers/discord-social-sdk/development-guides/managing-voice-chat.mdx index 1fbe8395bc..2a4b87c62a 100644 --- a/developers/discord-social-sdk/development-guides/managing-voice-chat.mdx +++ b/developers/discord-social-sdk/development-guides/managing-voice-chat.mdx @@ -196,7 +196,8 @@ client->SetNoiseCancellation(true); 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` 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`). +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