Fix experimental audio, add denoise, auto volume.Prep migration (#38874)

Uses the previously merged denoising crate (and fixes a bug in it that
snug in during refactoring) to add denoising to the microphone input. 

Adds automatic volume control for microphone and output.

Prepares for migrating to 16kHz SR mono:
The experimental audio path now picks the samplerate and channel count depending on a setting. It can handle incoming streams with both the current (future legacy) and new samplerate & channel count. These are url-encoded into the livekit track name

Release Notes:

- N/A
This commit is contained in:
David Kleingeld
2025-09-25 15:11:12 +02:00
committed by GitHub
parent 783ba389f7
commit 3c5e683fbe
15 changed files with 498 additions and 161 deletions
+33 -11
View File
@@ -272,21 +272,43 @@ pub struct TitleBarSettingsContent {
#[derive(Clone, PartialEq, Default, Serialize, Deserialize, JsonSchema, MergeFrom, Debug)]
pub struct AudioSettingsContent {
/// Opt into the new audio system.
#[serde(rename = "experimental.rodio_audio", default)]
pub rodio_audio: Option<bool>,
///
/// You need to rejoin a call for this setting to apply
#[serde(rename = "experimental.rodio_audio")]
pub rodio_audio: Option<bool>, // default is false
/// Requires 'rodio_audio: true'
///
/// Use the new audio systems automatic gain control for your microphone.
/// This affects how loud you sound to others.
#[serde(rename = "experimental.control_input_volume", default)]
pub control_input_volume: Option<bool>,
/// Automatically increase or decrease you microphone's volume. This affects how
/// loud you sound to others.
///
/// Recommended: off (default)
/// Microphones are too quite in zed, until everyone is on experimental
/// audio and has auto speaker volume on this will make you very loud
/// compared to other speakers.
#[serde(rename = "experimental.auto_microphone_volume")]
pub auto_microphone_volume: Option<bool>,
/// Requires 'rodio_audio: true'
///
/// Use the new audio systems automatic gain control on everyone in the
/// call. This makes call members who are too quite louder and those who are
/// too loud quieter. This only affects how things sound for you.
#[serde(rename = "experimental.control_output_volume", default)]
pub control_output_volume: Option<bool>,
/// Automatically increate or decrease the volume of other call members.
/// This only affects how things sound for you.
#[serde(rename = "experimental.auto_speaker_volume")]
pub auto_speaker_volume: Option<bool>,
/// Requires 'rodio_audio: true'
///
/// Remove background noises. Works great for typing, cars, dogs, AC. Does
/// not work well on music.
#[serde(rename = "experimental.denoise")]
pub denoise: Option<bool>,
/// Requires 'rodio_audio: true'
///
/// Use audio parameters compatible with the previous versions of
/// experimental audio and non-experimental audio. When this is false you
/// will sound strange to anyone not on the latest experimental audio. In
/// the future we will migrate by setting this to false
///
/// You need to rejoin a call for this setting to apply
#[serde(rename = "experimental.legacy_audio_compatible")]
pub legacy_audio_compatible: Option<bool>,
}
/// Control what info is collected by Zed.