This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+61
View File
@@ -0,0 +1,61 @@
// Metro module 12891 (f12892).
import { createApexExperiment } from "../experiments/apex/index";
const noiseCancellationConfig = {
useAGC2: true,
enableAnalog: false,
enableDigital: true,
headroom_db: 5,
max_gain_db: 50,
initial_gain_db: 15,
max_gain_change_db_per_second: 6,
max_output_noise_level_dbfs: -50,
fixed_gain_db: 0
};
const apexExperiment = createApexExperiment({
kind: "user",
name: "2025-09-agc2-v2",
defaultConfig: {
noiseCancellationDuringProcessing: false,
noiseCancellationConfig: {
useAGC2: false
}
},
variations: {
1: {
noiseCancellationDuringProcessing: true,
noiseCancellationConfig: {
useAGC2: false
}
},
2: {
noiseCancellationDuringProcessing: true,
noiseCancellationConfig,
vadKrispActivationThreshold: 0.5
},
3: {
noiseCancellationDuringProcessing: true,
noiseCancellationConfig,
vadKrispActivationThreshold: 0.55
},
4: {
noiseCancellationDuringProcessing: true,
noiseCancellationConfig,
vadKrispActivationThreshold: 0.6
},
5: {
noiseCancellationDuringProcessing: true,
noiseCancellationConfig,
vadKrispActivationThreshold: 0.65
},
6: {
noiseCancellationDuringProcessing: true,
noiseCancellationConfig,
vadKrispActivationThreshold: 0.7
}
}
});
export function getAGC2ExperimentConfig({ location: location2, disable = false }) {
return disable ? apexExperiment.definition.defaultConfig : apexExperiment.getConfig({
location: location2
});
}
@@ -0,0 +1,18 @@
// Metro module 12872 (f12873).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-05-av1-bitrate-tuning",
kind: "user",
defaultConfig: {
bitrate: 3500000
},
variations: {
1: {
bitrate: 3000000
},
2: {
bitrate: 2500000
}
}
});
export { apexExperiment as AV1StreamBitrateReductionExperiment };
@@ -0,0 +1,19 @@
// Metro module 12948 (f12949).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-av1-encode-linux",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function getAV1EncodeExperimentLinuxConfig(a0) {
return apexExperiment.getConfig({
location: a0
});
}
@@ -0,0 +1,17 @@
// Metro module 12958 (f12959).
import { createApexExperiment } from "../experiments/apex/index";
const defaultConfig = {
probeAudioEffects: false
};
const apexExperiment = createApexExperiment({
name: "2026-03-audio-effects-probe",
kind: "user",
defaultConfig,
variations: {
1: {
...defaultConfig,
probeAudioEffects: true
}
}
});
export default apexExperiment;
@@ -0,0 +1,94 @@
// Metro module 12900 (f12901).
import { createApexExperiment } from "../experiments/apex/index";
import { assertNever } from "../../utils/GlobalUtils";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-08-audio-fidelity",
defaultConfig: {
capSampleRate: false,
capChannelCount: false,
condition: "none"
},
variations: {
1: {
capSampleRate: true,
capChannelCount: false,
condition: "krisp"
},
2: {
capSampleRate: true,
capChannelCount: false,
condition: "noiseSuppression"
},
3: {
capSampleRate: true,
capChannelCount: false,
condition: "echoCancellation"
},
4: {
capSampleRate: true,
capChannelCount: false,
condition: "any"
},
5: {
capSampleRate: true,
capChannelCount: true,
condition: "krisp"
},
6: {
capSampleRate: true,
capChannelCount: true,
condition: "noiseSuppression"
},
7: {
capSampleRate: true,
capChannelCount: true,
condition: "echoCancellation"
},
8: {
capSampleRate: true,
capChannelCount: true,
condition: "any"
}
}
});
export function getAudioFidelityExperimentConfig(a0) {
return apexExperiment.getConfig({
location: a0.location
});
}
export function getVoiceFidelityCaps({ location: location2 }, a1) {
let krispEnabled;
if (a1.krispEnabled || a1.noiseSuppressionEnabled || a1.echoCancellationEnabled) {
const config = apexExperiment.getConfig({
location: location2
});
const condition = config.condition;
if (condition === "krisp") {
krispEnabled = a1.krispEnabled;
} else if (condition === "noiseSuppression") {
krispEnabled = a1.noiseSuppressionEnabled;
} else if (condition === "echoCancellation") {
krispEnabled = a1.echoCancellationEnabled;
} else if (condition === "any") {
krispEnabled = a1.krispEnabled || a1.noiseSuppressionEnabled || a1.echoCancellationEnabled;
} else {
krispEnabled = false;
if (condition !== "none") {
assertNever(condition);
krispEnabled = void 0;
}
}
return krispEnabled ? {
maxSampleRateHz: config.capSampleRate ? 32000 : 0,
maxChannelCount: config.capChannelCount ? 1 : 0
} : {
maxSampleRateHz: 0,
maxChannelCount: 0
};
}
return {
maxSampleRateHz: 0,
maxChannelCount: 0
};
}
@@ -0,0 +1,92 @@
// Metro module 12881 (f12882).
import { createExperiment } from "../experiments/index";
const experiment = createExperiment({
kind: "user",
id: "2024-06_rtc_pacer__simulcast",
label: "RTC Pacer & Golive Simulcast",
defaultConfig: {
enabled: true,
fullname: "bandwidth_estimation/trendline-window-duration-3750,robust-estimator/",
simulcastEnabled: false
},
treatments: [{
id: 1,
label: "Golive Simulcast without prober 720p@500k",
config: {
enabled: true,
fullname: "bandwidth_estimation/trendline-window-duration-3750,robust-estimator/",
simulcastEnabled: true
}
}, {
id: 2,
label: "Golive Simulcast 720p@500k",
config: {
enabled: true,
fullname: "bandwidth_estimation/trendline-window-duration-3750,robust-estimator/worker-pacer,worker-pacer-probe",
simulcastEnabled: true
}
}, {
id: 3,
label: "Golive with pacing",
config: {
enabled: true,
fullname: "bandwidth_estimation/trendline-window-duration-3750,robust-estimator/worker-pacer",
simulcastEnabled: false
}
}, {
id: 4,
label: "Golive with pacing and probing",
config: {
enabled: true,
fullname: "bandwidth_estimation/trendline-window-duration-3750,robust-estimator/worker-pacer,worker-pacer-probe",
simulcastEnabled: false
}
}, {
id: 5,
label: "Golive Simulcast 720p@750k",
config: {
enabled: true,
fullname: "bandwidth_estimation/trendline-window-duration-3750,robust-estimator/worker-pacer-probe,worker-lq-floor-750k",
simulcastEnabled: true
}
}, {
id: 6,
label: "Golive Simulcast 720p@1000k",
config: {
enabled: true,
fullname: "bandwidth_estimation/trendline-window-duration-3750,robust-estimator/worker-pacer-probe,worker-lq-floor-1000k",
simulcastEnabled: true
}
}]
});
const r31 = {
getConfig: function getConfig(a0, a1) {
const currentConfig = experiment.getCurrentConfig({
location: "e1c55b_1"
}, {
autoTrackExposure: a0
});
if (!this.supportsBandwidthEstimationExperimentFullname(currentConfig.fullname, a1)) {
currentConfig.enabled = false;
}
return currentConfig;
},
supportsBandwidthEstimationExperimentFullname: function supportsBandwidthEstimationExperimentFullname(a0, a1) {
const mediaEngineExperiments = this.getMediaEngineExperiments(a0);
if (mediaEngineExperiments === null) {
return false;
}
for (const item of mediaEngineExperiments) {
if (a1.includes(item)) {
continue;
}
return false;
}
return true;
},
getMediaEngineExperiments: (a0) => {
const r6 = a0.split("/");
return r6.length === 3 ? r6[0] === "bandwidth_estimation" ? r6[1].split(",").filter((item) => item.length !== 0) : null : null;
}
};
export default r31;
@@ -0,0 +1,15 @@
// Metro module 12949 (f12950).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2025-08-browser-hevc",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export default apexExperiment;
@@ -0,0 +1,22 @@
// Metro module 12863 (f12864).
import { createApexExperiment } from "../experiments/apex/index";
import { isDesktop } from "../../_bundle/Module501";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-03-browser-inverted-wants",
defaultConfig: {
invertWants: false
},
variations: {
1: {
invertWants: true
}
}
});
export function getBrowserInvertedWantsConfig(a0) {
return isDesktop() ? {
invertWants: false
} : apexExperiment.getConfig({
location: a0
});
}
@@ -0,0 +1,15 @@
// Metro module 12866 (f12867).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-04-browser-transceiver-padding-removal",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export { apexExperiment as BrowserTransceiverPaddingRemovalExperiment };
@@ -0,0 +1,198 @@
// Metro module 4264 (f4265).
import MediaEngineStore from "../../stores/MediaEngineStore";
import UserStore from "../../stores/UserStore";
import { DeviceTypes, MediaEngineContextTypes, SpeakingFlags } from "../../_bundle/Module4250";
import { StopWatch } from "../../_bundle/sleep";
import Frecency from "../../lib/Frecency";
import Module589 from "../../_bundle/Module589";
import Module12 from "../../_bundle/Module12";
import Dispatcher from "../../Dispatcher";
let c2502_8, c2502_9, c2502_10, c2502_11;
let c2502_7 = {
inputDeviceFrecency: DeviceTypes.AUDIO_INPUT,
outputDeviceFrecency: DeviceTypes.AUDIO_OUTPUT,
videoDeviceFrecency: DeviceTypes.VIDEO_INPUT
};
const r10 = {
afterCompute: () => {},
computeBonus: () => 100,
lookupKey: (a0) => a0,
maxSamples: 256,
numFrequentlyItems: Infinity
};
const r34 = {};
r34[DeviceTypes.AUDIO_INPUT] = new StopWatch();
r34[DeviceTypes.AUDIO_OUTPUT] = new StopWatch();
r34[DeviceTypes.VIDEO_INPUT] = new StopWatch();
c2502_8 = r34;
const r57 = {};
r57[DeviceTypes.AUDIO_INPUT] = {};
r57[DeviceTypes.AUDIO_OUTPUT] = {};
r57[DeviceTypes.VIDEO_INPUT] = {};
c2502_9 = r57;
const r64 = {};
r64[DeviceTypes.AUDIO_INPUT] = new Frecency(r10);
r64[DeviceTypes.AUDIO_OUTPUT] = new Frecency(r10);
r64[DeviceTypes.VIDEO_INPUT] = new Frecency(r10);
c2502_10 = r64;
class DeviceFrecencyStore extends Module589.PersistedStore {
static displayName = "DeviceFrecencyStore";
static persistKey = "DeviceFrecencyStore";
static migrations = [(a0) => Module12.mapKeys(a0, (a0, a1) => c2502_7[a1])];
initialize(c14060_0) {
this.waitFor(MediaEngineStore, UserStore);
[DeviceTypes.AUDIO_INPUT, DeviceTypes.AUDIO_OUTPUT, DeviceTypes.VIDEO_INPUT].forEach((item) => {
if ((c14060_0 == null ? void 0 : c14060_0[item]) != null) {
c2502_10[item].overwriteHistory(c14060_0[item]);
}
c2502_8[item].reset();
});
}
reset() {
[DeviceTypes.AUDIO_INPUT, DeviceTypes.AUDIO_OUTPUT, DeviceTypes.VIDEO_INPUT].forEach((item) => {
c2502_8[item].reset();
c2502_9[item] = {};
});
}
track(a0, a1, a2) {
if (c2502_9[a0][a1] == null) {
c2502_9[a0][a1] = 0;
}
const r7 = c2502_9[a0];
r7[a1] = r7[a1] + a2;
c2502_10[a0].track(a1, {
usesSinceLastTrack: a2
});
}
isSampling(a0) {
return c2502_8[a0].isRunning();
}
startSampling(a0) {
c2502_8[a0].start();
}
stopSampling(a0, a1) {
const r12 = c2502_8[a0];
r12.stop();
const r6 = r12.elapsed().asMilliseconds();
if (r6 > 0) {
let r16 = a1;
if (a1 == null) {
const r17 = {};
r17[DeviceTypes.AUDIO_INPUT] = {
getCurrentDeviceId: (a0) => a0.getInputDeviceId()
};
r17[DeviceTypes.AUDIO_OUTPUT] = {
getCurrentDeviceId: (a0) => a0.getOutputDeviceId()
};
r17[DeviceTypes.VIDEO_INPUT] = {
getCurrentDeviceId: (a0) => a0.getVideoDeviceId()
};
r16 = r17[a0].getCurrentDeviceId(MediaEngineStore);
}
this.track(a0, r16, r6);
}
r12.reset();
}
getState() {
const r0 = {};
r0[DeviceTypes.AUDIO_INPUT] = c2502_10[DeviceTypes.AUDIO_INPUT].usageHistory;
r0[DeviceTypes.AUDIO_OUTPUT] = c2502_10[DeviceTypes.AUDIO_OUTPUT].usageHistory;
r0[DeviceTypes.VIDEO_INPUT] = c2502_10[DeviceTypes.VIDEO_INPUT].usageHistory;
return r0;
}
getDeviceIdsSortedByFrecency(a0) {
return c2502_10[a0].frequently;
}
getUsageStats() {
const r3 = {};
r3[DeviceTypes.AUDIO_INPUT] = [];
r3[DeviceTypes.AUDIO_OUTPUT] = [];
r3[DeviceTypes.VIDEO_INPUT] = [];
let c14061_0 = r3;
[DeviceTypes.AUDIO_INPUT, DeviceTypes.AUDIO_OUTPUT].forEach((item) => {
if (this.isSampling(item)) {
this.stopSampling(item);
this.startSampling(item);
}
c14061_0[item] = Object.entries(c2502_9[item]);
});
return {
duration_input_device_used_ids: r3[DeviceTypes.AUDIO_INPUT].map((item) => {
const [r11, , ] = item;
return r11;
}),
duration_input_device_used_ms: r3[DeviceTypes.AUDIO_INPUT].map((item) => {
const [, r13] = item;
return r13;
}),
duration_output_device_used_ids: r3[DeviceTypes.AUDIO_OUTPUT].map((item) => {
const [r11, , ] = item;
return r11;
}),
duration_output_device_used_ms: r3[DeviceTypes.AUDIO_OUTPUT].map((item) => {
const [, r13] = item;
return r13;
})
};
}
}
c2502_11 = new DeviceFrecencyStore(Dispatcher, {
AUDIO_SET_INPUT_DEVICE: (a0) => {
const AUDIO_INPUT = DeviceTypes.AUDIO_INPUT;
const oldId = a0.oldId;
const isSampling2 = c2502_11.isSampling(AUDIO_INPUT);
let r0 = false;
if (isSampling2) {
c2502_11.stopSampling(AUDIO_INPUT, oldId);
c2502_11.startSampling(AUDIO_INPUT);
r0 = void 0;
}
return r0;
},
AUDIO_SET_OUTPUT_DEVICE: (a0) => {
const AUDIO_OUTPUT = DeviceTypes.AUDIO_OUTPUT;
const oldId = a0.oldId;
const isSampling2 = c2502_11.isSampling(AUDIO_OUTPUT);
let r0 = false;
if (isSampling2) {
c2502_11.stopSampling(AUDIO_OUTPUT, oldId);
c2502_11.startSampling(AUDIO_OUTPUT);
r0 = void 0;
}
return r0;
},
MEDIA_ENGINE_SET_VIDEO_DEVICE: (a0) => {
const VIDEO_INPUT = DeviceTypes.VIDEO_INPUT;
const oldId = a0.oldId;
const isSampling2 = c2502_11.isSampling(VIDEO_INPUT);
let r0 = false;
if (isSampling2) {
c2502_11.stopSampling(VIDEO_INPUT, oldId);
c2502_11.startSampling(VIDEO_INPUT);
r0 = void 0;
}
return r0;
},
SPEAKING: function handleSpeaking({ context, userId, speakingFlags }) {
if (context !== MediaEngineContextTypes.DEFAULT) {
return false;
}
const id = UserStore.getCurrentUser()?.id;
if (id == null) {
return false;
}
const r16 = userId === id ? DeviceTypes.AUDIO_INPUT : DeviceTypes.AUDIO_OUTPUT;
if (speakingFlags === SpeakingFlags.NONE && c2502_11.isSampling(r16)) {
c2502_11.stopSampling(r16);
} else {
if (!(speakingFlags !== SpeakingFlags.NONE && !c2502_11.isSampling(r16))) {
return false;
}
c2502_11.startSampling(r16);
}
},
RTC_CONNECTION_CLIENT_CONNECT: function handleConnect() {
c2502_11.reset();
}
});
export default c2502_11;
@@ -0,0 +1,15 @@
// Metro module 12968 (f12969).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-05-disable-camera-simulcast",
kind: "user",
defaultConfig: {
enableSimulcast: true
},
variations: {
1: {
enableSimulcast: false
}
}
});
export { apexExperiment as DisableCameraSimulcastExperiment };
@@ -0,0 +1,15 @@
// Metro module 12896 (f12897).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-04-disable-hook-frame-pacer",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export { apexExperiment as DisableHookFramePacerExperiment };
@@ -0,0 +1,19 @@
// Metro module 12899 (f12900).
import ApexExperiment from "../experiments/apex/ApexExperiment";
let c8889_0 = ApexExperiment({
kind: "user",
name: "2025-11-global-frame-pool-lock",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function getGlobalFramePoolLockExperimentConfig({ location: location2, disable = false }) {
return disable ? c8889_0.definition.defaultConfig : c8889_0.getConfig({
location: location2
});
}
@@ -0,0 +1,28 @@
// Metro module 12889 (f12890).
import { createApexExperiment } from "../experiments/apex/index";
const r14 = {
Never: "never",
Always: "always",
PermittedDevicesOnly: "permittedDevicesOnly"
};
const apexExperiment = createApexExperiment({
name: "2026-02-go-live-hdr",
kind: "user",
defaultConfig: {
hdrCaptureMode: r14.Never
},
variations: {
1: {
hdrCaptureMode: r14.Always
},
2: {
hdrCaptureMode: r14.PermittedDevicesOnly
}
}
});
export { r14 as HdrCaptureMode };
export function getGoLiveHdrConfig(a0) {
return apexExperiment.getConfig({
location: a0.location
});
}
@@ -0,0 +1,19 @@
// Metro module 12961 (f12962).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-03-ios-audio-interrupt-handling",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function getIOSAudioInterruptExperimentConfig(a0) {
return apexExperiment.getConfig({
location: a0
});
}
+129
View File
@@ -0,0 +1,129 @@
// Metro module 12965 (f12966).
import _slicedToArray from "../../_bundle/_slicedToArray";
import { WINDOWS_SETTINGS_SOUND_DEVICE_DEEPLINK_SEMVER } from "../go_live/Constants";
import { Logger } from "../../_bundle/log";
import { Timeout } from "../../_bundle/Timeout";
import { MediaEngineEvent } from "../../_bundle/Module4286";
import { isWindows } from "../../_bundle/Module501";
import Module12903 from "../../_bundle/Module12903";
import DiscordNative from "../../lib/DiscordNative";
import * as _DesktopNativeUtils from "../../utils/web/DesktopNativeUtils";
import Dispatcher from "../../Dispatcher";
let c8952_6 = new Logger("InputWatcher");
class InputWatcher {
constructor(a0, a1) {
const _this = this;
this.stateChangeTimeout = new Timeout();
this.inputDetected = void 0;
this.lastUpdateTime = performance.now();
let c20319_0 = this;
this.fetchInputDeviceOSConfig = async () => {
let c30595_2;
let c30595_3 = 0;
let c31670_0, c31670_1, c31670_2, c31670_3, c31670_4, c31670_5;
let r9 = "Failed to get device OS volume and/or mute state: ";
L24: {
L23: {
try {
c31670_0 = void 0;
c31670_1 = void 0;
c31670_2 = void 0;
c31670_3 = void 0;
c31670_4 = void 0;
if (!isWindows()) {
break L24;
}
if (!Module12903.satisfies(DiscordNative == null ? void 0 : DiscordNative.os.release, WINDOWS_SETTINGS_SOUND_DEVICE_DEEPLINK_SEMVER)) {
break L24;
}
c30595_3 = 1;
const inputDeviceId = c20319_0.mediaEngineStore.getInputDeviceId();
const guid = c20319_0.mediaEngineStore.getInputDevices()[inputDeviceId]?.guid;
c31670_0 = guid;
if (guid != null && guid !== "") {
await _DesktopNativeUtils.default.ensureModule("discord_voice");
r9 = "Failed to get device OS volume and/or mute state: ";
const r110 = await Promise.all([c20319_0.mediaEngine.getDeviceOSVolume(c31670_0), c20319_0.mediaEngine.getDeviceOSMuted(c31670_0)]);
r9 = "Failed to get device OS volume and/or mute state: ";
c31670_1 = r110;
c31670_2 = (0, _slicedToArray)(c31670_1, 2);
c31670_3 = c31670_2[0];
c31670_4 = c31670_2[1];
Dispatcher.dispatch({
type: "AUDIO_INPUT_DEVICE_OS_CONFIG_FETCHED",
osVolume: c31670_3,
osMuted: c31670_4
});
c30595_3 = 0;
break L23;
}
c30595_3 = 0;
break L24;
} catch ($e) {
const r34 = $e;
let r7 = r34;
c30595_2 = r34;
if (c30595_3 !== 0) {
while (true) {
try {
const r152 = c30595_2;
c30595_3 = 0;
c31670_5 = r152;
c8952_6.warn(HermesInternal.concat.call(r9, c31670_5));
break L23;
} catch (r148) {
r7 = r148;
c30595_2 = r148;
if (c30595_3 === 0) {
break;
}
}
}
}
throw r7;
}
}
return void 0;
}
};
this.handleSilence = (a0) => {
let c27388_1 = _this;
const inputDetected = !a0;
_this.stateChangeTimeout.start(a0 ? 5000 : 1500, async () => {
let c30596_0;
L12: {
c30596_0 = void 0;
c8952_6.info("Silence:", a0);
c27388_1.inputDetected = inputDetected;
c27388_1.lastUpdateTime = performance.now();
if (a0) {
await c27388_1.fetchInputDeviceOSConfig();
Dispatcher.dispatch({
type: "AUDIO_INPUT_DETECTED",
inputDetected: c27388_1.inputDetected,
lastUpdateTime: c27388_1.lastUpdateTime
});
break L12;
}
Dispatcher.dispatch({
type: "AUDIO_INPUT_DETECTED",
inputDetected: c27388_1.inputDetected,
lastUpdateTime: c27388_1.lastUpdateTime
});
return void 0;
}
});
};
this.mediaEngine = a0;
this.mediaEngineStore = a1;
this.mediaEngine.on(MediaEngineEvent.Silence, this.handleSilence);
}
reset() {
this.stateChangeTimeout.stop();
if (this.inputDetected != null) {
this.handleSilence(!this.inputDetected);
}
this.inputDetected = void 0;
}
}
export default InputWatcher;
@@ -0,0 +1,43 @@
// Metro module 12963 (f12964).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-04-krisp-v9-ios",
defaultConfig: {
models: [{
name: "small_NC_8k",
maxSampleRate: 8000,
filename: "krisp-nc-o-nb-v2.kef"
}, {
name: "small_NC",
maxSampleRate: 16000,
filename: "krisp-nc-o-lite-v1.kef"
}, {
name: "full_NC",
maxSampleRate: 96000,
filename: "krisp-nc-o-med-v7-fp16.kef"
}]
},
variations: {
1: {
models: [{
name: "small_NC_8k",
maxSampleRate: 8000,
filename: "krisp-nc-o-nb-v2.kef"
}, {
name: "small_NC_non_optimized",
maxSampleRate: 16000,
filename: "c6.f.s.laughter.da1785_non_optimized.kef"
}, {
name: "full_NC_non_optimized",
maxSampleRate: 96000,
filename: "krisp-nc-o-med-v7.kef"
}]
}
}
});
export function getKrispV9iOSModels() {
return apexExperiment.getConfig({
location: "setupKrisp"
}).models;
}
@@ -0,0 +1,19 @@
// Metro module 12902 (f12903).
import ApexExperiment from "../experiments/apex/ApexExperiment";
let c8892_0 = ApexExperiment({
kind: "user",
name: "2025-10-low-latency-rate-control",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function getLowLatencyRateControlExperimentConfig({ location: location2, disable = false }) {
return disable ? c8892_0.definition.defaultConfig : c8892_0.getConfig({
location: location2
});
}
@@ -0,0 +1,18 @@
// Metro module 10412 (f10413).
import MediaEngineStore from "../../stores/MediaEngineStore";
import { MediaEngineContextTypes } from "../../_bundle/Module4250";
import Dispatcher from "../../Dispatcher";
export function setPushToTalkState(a0) {
let c17935_0 = a0;
let isPriority = arguments[1];
if (isPriority === void 0) {
isPriority = false;
}
let c17935_1 = isPriority;
Dispatcher.dispatch({
type: "PUSH_TO_TALK_STATE_CHANGE",
isActive: a0,
isPriority
});
MediaEngineStore.getMediaEngine().eachConnection((a0) => a0.setForceAudioInput(c17935_0, c17935_1, false), MediaEngineContextTypes.DEFAULT);
}
@@ -0,0 +1,278 @@
// Metro module 4274 (f4275).
import AuthenticationStore from "../../stores/AuthenticationStore";
import StreamRTCConnectionStore from "../../stores/StreamRTCConnectionStore";
import { decodeStreamKey } from "../go_live/utils/StreamKeyUtils";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c2513_4, c2513_5, c2513_6, updateAveragedStats, getStatsHistoryAtIndex;
const updateAveragedStatsHelper = function updateAveragedStatsHelper(a0, a1, a2, outbound, a4) {
let r13, r44, r49, packetsSentOrReceived;
let r4 = a2;
const r14 = outbound.find((item) => item.type === "video");
if (a2 == null) {
r4 = {
packetsSentOrReceived: 0,
packetsLost: 0,
packetLossRate: 0,
frameRate: 0,
resolution: 0,
entropy: 0,
numDatapoints: 0,
frameRateAggregated: 0,
resolutionAggregated: 0,
entropyAggregated: 0,
minVersion: a0
};
}
if (r14 == null) {
return r4;
}
if ("packetsSent" in r14) {
let packetsSent = r14.packetsSent;
if (packetsSent == null) {
packetsSent = 0;
}
packetsSentOrReceived = packetsSent;
} else {
packetsSentOrReceived = r14.packetsReceived;
if (packetsSentOrReceived == null) {
packetsSentOrReceived = 0;
}
}
"packetsSent" in r14;
let packetsLost = r14.packetsLost;
if (packetsLost == null) {
packetsLost = 0;
}
if ("packetsSent" in r14) {
let frameRateEncode = r14.frameRateEncode;
if (frameRateEncode == null) {
frameRateEncode = 0;
}
r13 = frameRateEncode;
} else {
r13 = r14.frameRateDecode;
if (r13 == null) {
r13 = 0;
}
}
let r9 = r14.resolution?.height;
if (r9 == null) {
r9 = 0;
}
const r24 = "packetsSent" in r14;
let r25 = 0;
if (r24) {
let videoEntropy = r14.videoEntropy;
if (videoEntropy == null) {
videoEntropy = 0;
}
r25 = videoEntropy;
}
r4.numDatapoints = r4.numDatapoints + 1;
r4.frameRateAggregated = r4.frameRateAggregated + r13;
r4.resolutionAggregated = r4.resolutionAggregated + r9;
r4.entropyAggregated = r4.entropyAggregated + r25;
const r36 = a4 == null ? void 0 : a4.find((item) => item.type === "video");
if (r36 != null && a1 >= r4.minVersion) {
r4.numDatapoints = r4.numDatapoints - 1;
if ("packetsSent" in r36) {
let packetsSent2 = r36.packetsSent;
if (packetsSent2 == null) {
packetsSent2 = 0;
}
r44 = packetsSent2;
} else {
r44 = r36.packetsReceived;
if (r44 == null) {
r44 = 0;
}
}
"packetsSent" in r36;
let packetsLost2 = r36.packetsLost;
if (packetsLost2 == null) {
packetsLost2 = 0;
}
if ("packetsSent" in r36) {
let frameRateEncode2 = r36.frameRateEncode;
if (frameRateEncode2 == null) {
frameRateEncode2 = 0;
}
r49 = frameRateEncode2;
} else {
r49 = r36.frameRateDecode;
if (r49 == null) {
r49 = 0;
}
}
const r51 = "packetsSent" in r36;
let r52 = 0;
if (r51) {
let videoEntropy2 = r36.videoEntropy;
if (videoEntropy2 == null) {
videoEntropy2 = 0;
}
r52 = videoEntropy2;
}
let r56 = r36.resolution?.height;
if (r56 == null) {
r56 = 0;
}
r4.frameRateAggregated = r4.frameRateAggregated - r49;
r4.resolutionAggregated = r4.resolutionAggregated - r56;
r4.entropyAggregated = r4.entropyAggregated - r52;
r4.packetsSentOrReceived = packetsSentOrReceived - r44;
r4.packetsLost = packetsLost - packetsLost2;
} else {
r4.packetsSentOrReceived = packetsSentOrReceived;
r4.packetsLost = packetsLost;
}
r4.frameRate = r4.frameRateAggregated / r4.numDatapoints;
r4.resolution = r4.resolutionAggregated / r4.numDatapoints;
r4.entropy = r4.entropyAggregated / r4.numDatapoints;
r4.packetLossRate = r4.packetsLost / (r4.packetsSentOrReceived + r4.packetsLost);
return r4;
};
updateAveragedStats = function updateAveragedStats(a0, mediaEngineConnectionId, a2, a3) {
if (a0[mediaEngineConnectionId] == null) {
a0[mediaEngineConnectionId] = {};
}
const id = AuthenticationStore.getId();
const r38 = a0[mediaEngineConnectionId];
const version = a2.version;
let r14 = a3?.version;
if (r14 == null) {
r14 = 0;
}
r38[id] = updateAveragedStatsHelper(version, r14, a0[mediaEngineConnectionId][id], a2.stats.rtp.outbound, a3 == null ? void 0 : a3.stats.rtp.outbound);
for (const item of Object.keys(a2.stats.rtp.inbound)) {
const r61 = a0[mediaEngineConnectionId];
const version2 = a2.version;
let r63 = a3?.version;
if (r63 == null) {
r63 = 0;
}
const r64 = a0[mediaEngineConnectionId];
r61[item] = updateAveragedStatsHelper(version2, r63, r64[item], a2.stats.rtp.inbound[item], a3 == null ? void 0 : a3.stats.rtp.inbound[item]);
}
};
getStatsHistoryAtIndex = function getStatsHistoryAtIndex(mediaEngineConnectionId, a1) {
if (mediaEngineConnectionId == null) {
return null;
}
const r8 = c2513_4[mediaEngineConnectionId];
return r8 == null ? null : r8.length <= 15 ? null : r8[r8.length - 15 - 1];
};
c2513_4 = {};
c2513_5 = {};
c2513_6 = {};
class MediaEngineStatsStore extends Module589.Store {
static displayName = "MediaEngineStatsStore";
initialize() {
this.waitFor(AuthenticationStore, StreamRTCConnectionStore);
}
getConnectionStats(a0) {
const r3 = a0 == null;
let r4 = null;
if (!r3) {
const r9 = c2513_4[a0];
r4 = r9 == null ? null : r9.length <= 0 ? null : r9[r9.length - 0 - 1];
}
return r4;
}
getLastConnectionStats(a0) {
const r3 = a0 == null;
let r4 = null;
if (!r3) {
const r9 = c2513_4[a0];
r4 = r9 == null ? null : r9.length <= 1 ? null : r9[r9.length - 1 - 1];
}
return r4;
}
getStatsHistory(a0) {
let r4;
if (a0 == null) {
r4 = [];
} else {
r4 = c2513_4[a0];
if (r4 == null) {
r4 = [];
}
}
return r4;
}
getAccumulatedPerformanceStats(a0, a1, a2) {
if (a0 == null) {
return null;
}
const r7 = (a2 === "long" ? c2513_5 : c2513_6)[a0];
let r8 = r7 == null ? void 0 : r7[a1];
if (r8 == null) {
r8 = null;
}
return r8;
}
}
const mediaEngineStatsStore = new MediaEngineStatsStore(Dispatcher, {
MEDIA_ENGINE_CONNECTION_STATS: function handleMediaEngineConnectionStats({ connectionStats }) {
const r7 = {};
for (const item of connectionStats) {
const mediaEngineConnectionId = item.mediaEngineConnectionId;
if (mediaEngineConnectionId.length !== 0) {
r7[mediaEngineConnectionId] = item;
if (!(mediaEngineConnectionId in c2513_4)) {
c2513_4[mediaEngineConnectionId] = [];
}
c2513_4[mediaEngineConnectionId].push(item);
const r47 = c2513_4[mediaEngineConnectionId].length > 30 ? c2513_4[mediaEngineConnectionId].shift() : void 0;
let r58 = getStatsHistoryAtIndex(mediaEngineConnectionId, 15);
if (r58 == null) {
r58 = void 0;
}
updateAveragedStats(c2513_6, mediaEngineConnectionId, item, r58);
updateAveragedStats(c2513_5, mediaEngineConnectionId, item, r47);
}
}
},
MEDIA_ENGINE_CONNECTION_STATS_HISTORY_RESET: function handleResetStats({ mediaEngineConnectionId }) {
if (mediaEngineConnectionId != null) {
delete c2513_4[mediaEngineConnectionId];
delete c2513_5[mediaEngineConnectionId];
delete c2513_6[mediaEngineConnectionId];
}
},
STREAM_UPDATE: function handleStreamUpdate(a0) {
const streamKey = a0.streamKey;
if (a0.paused) {
return false;
}
const rTCConnection = StreamRTCConnectionStore.getRTCConnection(streamKey);
const r11 = rTCConnection == null ? void 0 : rTCConnection.getMediaEngineConnectionId();
if (r11 == null) {
return false;
}
const ownerId = decodeStreamKey(streamKey).ownerId;
const r8 = c2513_5[r11];
if ((r8 == null ? void 0 : r8[ownerId]) != null) {
delete c2513_5[r11][ownerId];
}
const r26 = c2513_6[r11];
if ((r26 == null ? void 0 : r26[ownerId]) != null) {
delete c2513_6[r11][ownerId];
}
},
RTC_CONNECTION_VIDEO: function handleVideo({ userId, mediaEngineConnectionId }) {
if (mediaEngineConnectionId == null) {
return false;
}
const r8 = c2513_5[mediaEngineConnectionId];
if ((r8 == null ? void 0 : r8[userId]) != null) {
delete c2513_5[mediaEngineConnectionId][userId];
}
const r13 = c2513_6[mediaEngineConnectionId];
if ((r13 == null ? void 0 : r13[userId]) != null) {
delete c2513_6[mediaEngineConnectionId][userId];
}
}
});
export default mediaEngineStatsStore;
@@ -0,0 +1,19 @@
// Metro module 12962 (f12963).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-07-mkl-zen-cpu-dispatch-override",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function getMklZenOverrideExperimentConfig(a0) {
return apexExperiment.getConfig({
location: a0
});
}
@@ -0,0 +1,19 @@
// Metro module 10768 (f10769).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-02-mobile-volume-output-slider-removal",
kind: "user",
defaultConfig: {
audioOutputPresent: true,
nonContextualStreamOutputPresent: true,
showTileVolumeIndicator: false
},
variations: {
1: {
audioOutputPresent: false,
nonContextualStreamOutputPresent: false,
showTileVolumeIndicator: true
}
}
});
export default apexExperiment;
@@ -0,0 +1,19 @@
// Metro module 12966 (f12967).
import ApexExperiment from "../experiments/apex/ApexExperiment";
let c8953_0 = ApexExperiment({
kind: "user",
name: "2026-07-nvenc-reconstructed-frames",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function getNvencReconstructedFrameExperimentConfig({ location: location2, disable = false }) {
return disable ? c8953_0.definition.defaultConfig : c8953_0.getConfig({
location: location2
});
}
@@ -0,0 +1,30 @@
// Metro module 12870 (f12871).
import { ProcessPriority } from "../../_bundle/Module4250";
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-02-process-boost-on-voice",
kind: "user",
defaultConfig: {
processPriority: ProcessPriority.HIGH,
threadPriorityConfiguration: 0
},
variations: {
1: {
processPriority: ProcessPriority.NORMAL,
threadPriorityConfiguration: 0
},
2: {
processPriority: ProcessPriority.NORMAL,
threadPriorityConfiguration: 1
},
3: {
processPriority: ProcessPriority.NORMAL,
threadPriorityConfiguration: 2
},
4: {
processPriority: ProcessPriority.NORMAL,
threadPriorityConfiguration: 3
}
}
});
export { apexExperiment as ProcessBoostExperiment };
@@ -0,0 +1,17 @@
// Metro module 12871 (f12872).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-server-ladder",
kind: "user",
defaultConfig: {
bitrate: 9000000,
enabled: false
},
variations: {
1: {
bitrate: 3500000,
enabled: true
}
}
});
export { apexExperiment as ServerLadderExperiment };
@@ -0,0 +1,27 @@
// Metro module 12964 (f12965).
import { createApexExperiment } from "../experiments/apex/index";
const defaultConfig = {
resetSilenceWarningOnDeviceChange: false,
resetSilenceWarningAfterNMinutes: void 0,
enableHardwareSilenceWarning: false
};
const apexExperiment = createApexExperiment({
name: "2026-02-silence-warning-aggression",
kind: "user",
defaultConfig,
variations: {
1: {
...defaultConfig,
resetSilenceWarningOnDeviceChange: true
},
2: {
...defaultConfig,
resetSilenceWarningAfterNMinutes: 10
},
3: {
...defaultConfig,
enableHardwareSilenceWarning: true
}
}
});
export default apexExperiment;
@@ -0,0 +1,19 @@
// Metro module 12901 (f12902).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-06-systemwide-echo-cancellation-for-people-who-refuse-to-wear-headphones",
defaultConfig: {
echoReferenceMode: "mix"
},
variations: {
1: {
echoReferenceMode: "auto"
}
}
});
export function getSystemwideEchoCancellationExperimentConfig(a0) {
return apexExperiment.getConfig({
location: a0.location
});
}
@@ -0,0 +1,17 @@
// Metro module 12898 (f12899).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-upscale-small-captured-frames",
kind: "user",
defaultConfig: {
minCaptureWidth: 0,
minCaptureHeight: 0
},
variations: {
1: {
minCaptureWidth: 130,
minCaptureHeight: 130
}
}
});
export { apexExperiment as UpscaleSmallCapturedFramesExperiment };
@@ -0,0 +1,19 @@
// Metro module 12890 (f12891).
import ApexExperiment from "../experiments/apex/ApexExperiment";
let c8887_0 = ApexExperiment({
kind: "user",
name: "2025-10-vad-before-processing",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function getVADBeforeProcessingExperimentConfig({ location: location2, disable = false }) {
return disable ? c8887_0.definition.defaultConfig : c8887_0.getConfig({
location: location2
});
}
@@ -0,0 +1,15 @@
// Metro module 12967 (f12968).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-03-video-capture-device-no-reuse",
kind: "user",
defaultConfig: {
overrideDeviceReuse: false
},
variations: {
1: {
overrideDeviceReuse: true
}
}
});
export { apexExperiment as VideoCaptureDeviceNoReuseExperiment };
@@ -0,0 +1,15 @@
// Metro module 12897 (f12898).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-04-video-hook-dx12",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export { apexExperiment as VideoHookDX12Experiment };
@@ -0,0 +1,18 @@
// Metro module 16659 (f16660).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-03-video-stutter-mitigation",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
0: {
enabled: false
},
1: {
enabled: true
}
}
});
export default apexExperiment;
@@ -0,0 +1,15 @@
// Metro module 12895 (f12896).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-02-wgc-dirty-regions-all",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export { apexExperiment as WGCDirtyRegionsAllExperiment };
@@ -0,0 +1,15 @@
// Metro module 12894 (f12895).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-02-wgc-dirty-regions",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export { apexExperiment as WGCDirtyRegionsExperiment };
@@ -0,0 +1,19 @@
// Metro module 12952 (f12953).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-wmf-cpu-encode-intel",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function getWmfCpuEncodeIntel(a0) {
return apexExperiment.getConfig({
location: a0
});
}
@@ -0,0 +1,19 @@
// Metro module 12950 (f12951).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2025-12-wmf-gpu-encode",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function getWmfGpuEncode(a0) {
return apexExperiment.getConfig({
location: a0
});
}
@@ -0,0 +1,19 @@
// Metro module 12951 (f12952).
import { createApexExperiment } from "../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-01-wmf-gpu-encode-intel",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function getWmfGpuEncodeIntel(a0) {
return apexExperiment.getConfig({
location: a0
});
}
@@ -0,0 +1,15 @@
// Metro module 12880 (f12881).
import { MediaEngineContextTypes } from "../../_bundle/Module4250";
import Dispatcher from "../../Dispatcher";
export default function dispatchAutoDisableVideo(userId, videoToggleState) {
Dispatcher.wait(() => {
Dispatcher.dispatch({
type: "AUDIO_SET_LOCAL_VIDEO_DISABLED",
context: MediaEngineContextTypes.DEFAULT,
userId,
videoToggleState,
persist: false,
isAutomatic: true
});
});
};
@@ -0,0 +1,17 @@
// Metro module 16336 (f16337).
import AutomaticLifecycleManager from "../../../lib/AutomaticLifecycleManager";
import { presentNoiseCancellationError, presentVoiceActivityDetectionError } from "../../toast/native/ToastUtils";
class VoiceProcessingErrorManager extends AutomaticLifecycleManager {
actions = {
MEDIA_ENGINE_NOISE_CANCELLATION_ERROR: () => this.handleNoiseCancellationError(),
MEDIA_ENGINE_VOICE_ACTIVITY_DETECTION_ERROR: () => this.handleVoiceActivityDetectionError()
};
handleNoiseCancellationError = () => {
presentNoiseCancellationError();
};
handleVoiceActivityDetectionError = () => {
presentVoiceActivityDetectionError();
};
}
const voiceProcessingErrorManager = new VoiceProcessingErrorManager();
export default voiceProcessingErrorManager;
+26
View File
@@ -0,0 +1,26 @@
// Metro module 12885 (f12886).
import { AnalyticEvents } from "../../Constants";
import { VideoHealthManager } from "../../lib/VideoHealthManager";
import AnalyticsUtils from "../../utils/AnalyticsUtils";
let c8884_3, c8884_4;
export default function trackVideoToggle(a0, a1, a2) {
const defaultConfig = VideoHealthManager.defaultConfig;
const { featureEnabled, windowLength, allowedPoorFpsRatio, fpsThreshold, backoffTimeSec } = defaultConfig;
const VIDEO_TOGGLED = AnalyticEvents.VIDEO_TOGGLED;
const rtc_connection_id = c8884_3 == null ? void 0 : c8884_3();
AnalyticsUtils.track(VIDEO_TOGGLED, {
video_toggle_reason: a1,
toggled_user_id: a0,
rtc_connection_id,
media_session_id: c8884_4 == null ? void 0 : c8884_4(),
video_health_manager_window_length: featureEnabled ? windowLength : null,
video_health_manager_poor_fps_ratio: featureEnabled ? allowedPoorFpsRatio : null,
video_health_manager_fps_threshold: featureEnabled ? fpsThreshold : null,
is_video_shown: a2,
video_health_manager_backoff_time_seconds: featureEnabled ? backoffTimeSec : null
});
};
export function setVideoToggleAnalyticsParams(a0, a1) {
c8884_3 = a0;
c8884_4 = a1;
}
@@ -0,0 +1,26 @@
// Metro module 10811 (f10812).
import { useCallback } from "react";
import MediaEngineStore from "../../stores/MediaEngineStore";
import { useStateFromStores } from "../../_bundle/Module589";
import AudioActionCreators from "../../actions/AudioActionCreators";
export default function useMuteAwareLocalVolume(a0, a1) {
let c18272_0 = a0;
return {
effectiveVolume: useStateFromStores([MediaEngineStore], () => {
const r7 = c18272_0 == null;
let r2 = 0;
if (!r7) {
r2 = MediaEngineStore.isLocalMute(c18272_0, a1) ? 0 : MediaEngineStore.getLocalVolume(c18272_0, a1);
}
return r2;
}),
handleVolumeChange: useCallback((a0) => {
if (c18272_0 != null) {
if (a0 > 0 && MediaEngineStore.isLocalMute(c18272_0, a1)) {
AudioActionCreators.toggleLocalMute(c18272_0, a1);
}
AudioActionCreators.setLocalVolume(c18272_0, a0, a1);
}
}, [a0, a1])
};
};