decord/source/modules/user_settings/voice/AudioSettingsUtils.tsx

35 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 9051
// Function ID: 9052
2026-07-20 16:05:17 +00:00
// Name: snapVolumeToDefault
2026-08-05 07:35:12 +00:00
// Dependencies: [685, 4351, 9052, 4702, 2]
2026-07-20 16:05:17 +00:00
// Exports: coerceAudioContextForProto, snapVolumeToDefault
2026-08-05 07:35:12 +00:00
// Module 9051 (snapVolumeToDefault)
2026-07-23 10:11:24 +00:00
import { ProtoAudioSettingsContextTypes as closure_2 } from "MAX_FAVORITES";
let result = require("AudioSettingsDefaultVolumes").fileFinishedImporting("modules/user_settings/voice/AudioSettingsUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const snapVolumeToDefault = function snapVolumeToDefault(USER, DEFAULT) {
2026-08-05 07:35:12 +00:00
if (DEFAULT === require(4351) /* BaseConnectionEvent */.MediaEngineContextTypes.STREAM) {
USER = tmp(9052).AudioSettingsDefaultVolumes.STREAM;
2026-07-20 16:05:17 +00:00
} else {
2026-08-05 07:35:12 +00:00
USER = tmp(9052).AudioSettingsDefaultVolumes.USER;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp3 = USER;
2026-08-05 07:35:12 +00:00
let tmpResult = tmp(4702);
2026-07-29 08:29:29 +00:00
const result = tmpResult.amplitudeToPerceptual(USER);
2026-08-05 07:35:12 +00:00
tmpResult = tmp(4702);
2026-07-29 08:29:29 +00:00
if (Math.abs(result - tmpResult.amplitudeToPerceptual(USER)) < 1) {
tmp3 = USER;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp3;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const coerceAudioContextForProto = function coerceAudioContextForProto(first) {
2026-08-05 07:35:12 +00:00
if (require(4351) /* BaseConnectionEvent */.MediaEngineContextTypes.DEFAULT === first) {
2026-07-20 16:05:17 +00:00
return constants.USER;
2026-08-05 07:35:12 +00:00
} else if (tmp(4351).MediaEngineContextTypes.STREAM === first) {
2026-07-20 16:05:17 +00:00
return constants.STREAM;
}
2026-07-29 08:29:29 +00:00
tmp = require;
2026-07-20 16:05:17 +00:00
};