2026-07-25 08:10:48 +00:00
|
|
|
// Module ID: 8772
|
2026-07-27 11:26:19 +00:00
|
|
|
// Function ID: 69484
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: snapVolumeToDefault
|
2026-07-25 08:10:48 +00:00
|
|
|
// Dependencies: [662, 4228, 8773, 4581, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: coerceAudioContextForProto, snapVolumeToDefault
|
|
|
|
|
|
2026-07-25 08:10:48 +00:00
|
|
|
// Module 8772 (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
|
|
|
|
|
|
|
|
export const snapVolumeToDefault = function snapVolumeToDefault(volume, DEFAULT) {
|
|
|
|
|
let tmp = volume;
|
2026-07-25 08:10:48 +00:00
|
|
|
if (DEFAULT === require(4228) /* getMediaEngineImpl */.MediaEngineContextTypes.STREAM) {
|
|
|
|
|
let USER = require(8773) /* AudioSettingsDefaultVolumes */.AudioSettingsDefaultVolumes.STREAM;
|
2026-07-20 16:05:17 +00:00
|
|
|
} else {
|
2026-07-25 08:10:48 +00:00
|
|
|
USER = require(8773) /* AudioSettingsDefaultVolumes */.AudioSettingsDefaultVolumes.USER;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-25 08:10:48 +00:00
|
|
|
const result = require(4581) /* perceptualToAmplitude */.amplitudeToPerceptual(USER);
|
|
|
|
|
const obj = require(4581) /* perceptualToAmplitude */;
|
2026-07-20 16:05:17 +00:00
|
|
|
if (Math.abs(result - obj2.amplitudeToPerceptual(tmp)) < 1) {
|
|
|
|
|
tmp = USER;
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
};
|
|
|
|
|
export const coerceAudioContextForProto = function coerceAudioContextForProto(arg0) {
|
2026-07-25 08:10:48 +00:00
|
|
|
if (require(4228) /* getMediaEngineImpl */.MediaEngineContextTypes.DEFAULT === arg0) {
|
2026-07-20 16:05:17 +00:00
|
|
|
return constants.USER;
|
2026-07-25 08:10:48 +00:00
|
|
|
} else if (require(4228) /* getMediaEngineImpl */.MediaEngineContextTypes.STREAM === arg0) {
|
2026-07-20 16:05:17 +00:00
|
|
|
return constants.STREAM;
|
|
|
|
|
}
|
|
|
|
|
};
|