Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
// Module ID: 14851
|
|
// Function ID: 14852
|
|
// Name: getVolumeForSound
|
|
// Dependencies: [1992, 5259, 2019, 2]
|
|
// Exports: default, getPerceptualSoundboardVolume
|
|
|
|
// Module 14851 (getVolumeForSound)
|
|
import UserSettings from "UserSettings" /* 2019 */;
|
|
import PerceptualVolumeUtils from "PerceptualVolumeUtils" /* 5259 */;
|
|
import MediaEngineStore from "MediaEngineStore" /* 1992 */;
|
|
|
|
require = fn;
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/soundboard/getVolumeForSound.tsx");
|
|
|
|
export default function getVolumeForSound(arg0, USER) {
|
|
let tmp = USER;
|
|
if (USER === undefined) {
|
|
const SoundboardSettings = UserSettings.SoundboardSettings;
|
|
const setting = SoundboardSettings.getSetting();
|
|
let num;
|
|
if (setting != null) {
|
|
num = setting.volume;
|
|
}
|
|
if (num == null) {
|
|
num = 100;
|
|
}
|
|
tmp = num;
|
|
}
|
|
const result = PerceptualVolumeUtils.amplitudeToPerceptual(tmp) / 100;
|
|
return Math.min(arg0 * result * Math.min(MediaEngineStore.getOutputVolume() / 100, 1), 1);
|
|
};
|
|
export const getPerceptualSoundboardVolume = function getPerceptualSoundboardVolume(USER) {
|
|
let num = USER;
|
|
if (USER == null) {
|
|
num = 100;
|
|
}
|
|
return PerceptualVolumeUtils.amplitudeToPerceptual(num) / 100;
|
|
};
|