Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
// Module ID: 14629
|
|
// Function ID: 14630
|
|
// Name: getVolumeForSound
|
|
// Dependencies: [1908, 5096, 1935, 2]
|
|
// Exports: default, getPerceptualSoundboardVolume
|
|
|
|
// Module 14629 (getVolumeForSound)
|
|
import UserSettings from "UserSettings" /* 1935 */;
|
|
import PerceptualVolumeUtils from "PerceptualVolumeUtils" /* 5096 */;
|
|
import MediaEngineStore from "MediaEngineStore" /* 1908 */;
|
|
|
|
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;
|
|
};
|