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

35 lines
1.3 KiB
TypeScript
Raw Normal View History

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