Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
49 lines
1.2 KiB
TypeScript
49 lines
1.2 KiB
TypeScript
// Module ID: 5066
|
|
// Function ID: 5067
|
|
// Name: perceptual_volume/PerceptualVolumeUtils
|
|
// Dependencies: [2]
|
|
// Exports: amplitudeToPerceptual, perceptualToAmplitude
|
|
|
|
// Module 5066 (perceptual_volume/PerceptualVolumeUtils)
|
|
import size from "module_2" /* 2 */;
|
|
|
|
let result = size.fileFinishedImporting("modules/perceptual_volume/PerceptualVolumeUtils.tsx");
|
|
|
|
export const perceptualToAmplitude = function perceptualToAmplitude(arg0) {
|
|
let num = arg1;
|
|
if (arg1 === undefined) {
|
|
num = 100;
|
|
}
|
|
if (0 === arg0) {
|
|
return 0;
|
|
} else {
|
|
const result = arg0 / num;
|
|
if (result < 1) {
|
|
const _Math2 = Math;
|
|
let powResult = Math.pow(result, 2.8);
|
|
} else {
|
|
const _Math = Math;
|
|
powResult = Math.pow(10, 6 * (result - 1) / 20);
|
|
}
|
|
return powResult * num;
|
|
}
|
|
};
|
|
export const amplitudeToPerceptual = function amplitudeToPerceptual(USER) {
|
|
let num = arg1;
|
|
if (arg1 === undefined) {
|
|
num = 100;
|
|
}
|
|
if (0 === USER) {
|
|
return 0;
|
|
} else {
|
|
const result = USER / num;
|
|
if (result < 1) {
|
|
const _Math2 = Math;
|
|
let powResult = Math.pow(result, 0.35714285714285715);
|
|
} else {
|
|
const _Math = Math;
|
|
powResult = 20 * Math.log10(result) / 6 + 1;
|
|
}
|
|
return powResult * num;
|
|
}
|
|
};
|