2026-09-10 05:38:07 +00:00
|
|
|
// Module ID: 9124
|
|
|
|
|
// Function ID: 9125
|
|
|
|
|
// Name: AudioSettingsUtils
|
|
|
|
|
// Dependencies: [1084, 4629, 9125, 5029, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: coerceAudioContextForProto, snapVolumeToDefault
|
|
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
// Module 9124 (AudioSettingsUtils)
|
|
|
|
|
import UserSettingsConstants from "UserSettingsConstants" /* 1084 */;
|
|
|
|
|
import BaseConnectionEvent from "BaseConnectionEvent" /* 4629 */;
|
|
|
|
|
import PerceptualVolumeUtils from "PerceptualVolumeUtils" /* 5029 */;
|
|
|
|
|
import size from "module_2" /* 2 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
const constants = UserSettingsConstants.ProtoAudioSettingsContextTypes;
|
|
|
|
|
let result = size.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-24 06:08:38 +00:00
|
|
|
if (DEFAULT === BaseConnectionEvent.MediaEngineContextTypes.STREAM) {
|
2026-09-10 05:38:07 +00:00
|
|
|
USER = tmp(9125).AudioSettingsDefaultVolumes.STREAM;
|
2026-07-20 16:05:17 +00:00
|
|
|
} else {
|
2026-09-10 05:38:07 +00:00
|
|
|
USER = tmp(9125).AudioSettingsDefaultVolumes.USER;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
let tmp3 = USER;
|
2026-09-10 05:38:07 +00:00
|
|
|
const result = PerceptualVolumeUtils.amplitudeToPerceptual(USER);
|
|
|
|
|
const tmpResult = PerceptualVolumeUtils;
|
|
|
|
|
if (Math.abs(result - tmpResult2.amplitudeToPerceptual(USER)) < 1) {
|
2026-07-29 08:29:29 +00:00
|
|
|
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-09-10 05:38:07 +00:00
|
|
|
export const coerceAudioContextForProto = function coerceAudioContextForProto(arg0) {
|
|
|
|
|
if (BaseConnectionEvent.MediaEngineContextTypes.DEFAULT === arg0) {
|
2026-07-20 16:05:17 +00:00
|
|
|
return constants.USER;
|
2026-09-10 05:38:07 +00:00
|
|
|
} else if (BaseConnectionEvent.MediaEngineContextTypes.STREAM === arg0) {
|
2026-07-20 16:05:17 +00:00
|
|
|
return constants.STREAM;
|
|
|
|
|
}
|
|
|
|
|
};
|