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

35 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 9656
// Function ID: 9657
2026-07-20 16:05:17 +00:00
// Name: snapVolumeToDefault
2026-08-15 05:55:55 +00:00
// Dependencies: [685, 4569, 9657, 4782, 2]
2026-07-20 16:05:17 +00:00
// Exports: coerceAudioContextForProto, snapVolumeToDefault
2026-08-15 05:55:55 +00:00
// Module 9656 (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-15 05:55:55 +00:00
if (DEFAULT === require(4569) /* BaseConnectionEvent */.MediaEngineContextTypes.STREAM) {
USER = tmp(9657).AudioSettingsDefaultVolumes.STREAM;
2026-07-20 16:05:17 +00:00
} else {
2026-08-15 05:55:55 +00:00
USER = tmp(9657).AudioSettingsDefaultVolumes.USER;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp3 = USER;
2026-08-15 05:55:55 +00:00
let tmpResult = tmp(4782);
2026-07-29 08:29:29 +00:00
const result = tmpResult.amplitudeToPerceptual(USER);
2026-08-15 05:55:55 +00:00
tmpResult = tmp(4782);
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-15 05:55:55 +00:00
if (require(4569) /* BaseConnectionEvent */.MediaEngineContextTypes.DEFAULT === first) {
2026-07-20 16:05:17 +00:00
return constants.USER;
2026-08-15 05:55:55 +00:00
} else if (tmp(4569).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
};