92 lines
2.7 KiB
TypeScript
92 lines
2.7 KiB
TypeScript
// Module ID: 10276
|
|
// Function ID: 79333
|
|
// Name: createSound
|
|
// Dependencies: [10277, 3970, 8883, 3, 10279, 10280, 2]
|
|
// Exports: createSoundForPack, playSound
|
|
|
|
// Module 10276 (createSound)
|
|
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
|
|
import closure_4 from "_isNativeReflectConstruct";
|
|
import { SoundOutputChannel } from "SoundOutputChannel";
|
|
import importDefaultResult from "timestamp";
|
|
|
|
const require = arg1;
|
|
function createSound(stage_waiting, soundboard_sound, _volume, DEFAULT, flag) {
|
|
let num = _volume;
|
|
if (_volume === undefined) {
|
|
num = 1;
|
|
}
|
|
if (DEFAULT === undefined) {
|
|
DEFAULT = SoundOutputChannel.DEFAULT;
|
|
}
|
|
if (flag === undefined) {
|
|
flag = false;
|
|
}
|
|
const mobileAudioSound = new require(10280) /* RNSound */.MobileAudioSound(stage_waiting, soundboard_sound, num, DEFAULT, flag);
|
|
return mobileAudioSound;
|
|
}
|
|
importDefaultResult = new importDefaultResult("SoundUtils");
|
|
const result = require("SoundOutputChannel").fileFinishedImporting("modules/sound_playback/SoundUtils.tsx");
|
|
|
|
export const createSoundForPack = function createSoundForPack(call_calling, soundpack) {
|
|
let num = arg2;
|
|
let DEFAULT = arg3;
|
|
if (arg2 === undefined) {
|
|
num = 1;
|
|
}
|
|
if (DEFAULT === undefined) {
|
|
DEFAULT = SoundOutputChannel.DEFAULT;
|
|
}
|
|
const tmp3 = importDefault(10279)(soundpack)[call_calling];
|
|
let tmp4 = call_calling;
|
|
if (null != tmp3) {
|
|
tmp4 = tmp3;
|
|
}
|
|
return createSound(tmp4, call_calling, num, DEFAULT);
|
|
};
|
|
export { createSound };
|
|
export const playSound = function playSound(arg0, arg1, arg2, arg3, outputChannel) {
|
|
let num = arg1;
|
|
if (arg1 === undefined) {
|
|
num = 1;
|
|
}
|
|
let closure_0 = arg2;
|
|
if (!disableSounds.disableSounds) {
|
|
let soundpack = arg3;
|
|
if (null == arg3) {
|
|
soundpack = soundpack.getSoundpack();
|
|
}
|
|
const tmp3Result = importDefault(10279)(soundpack);
|
|
if (null == tmp3Result) {
|
|
const _HermesInternal = HermesInternal;
|
|
importDefaultResult.log("Unable to find sound for pack name: " + arg3);
|
|
}
|
|
let tmp13 = arg0;
|
|
if (null != tmp3Result[arg0]) {
|
|
tmp13 = tmp12;
|
|
}
|
|
outputChannel = undefined;
|
|
if (null != outputChannel) {
|
|
outputChannel = outputChannel.outputChannel;
|
|
}
|
|
if (null == outputChannel) {
|
|
outputChannel = SoundOutputChannel.DEFAULT;
|
|
}
|
|
let prop;
|
|
if (null != outputChannel) {
|
|
prop = outputChannel.trackNotificationFailure;
|
|
}
|
|
const tmp11Result = createSound(tmp13, arg0, num, outputChannel, null != prop && prop);
|
|
if (null != arg2) {
|
|
tmp11Result.playWithListener().then((arg0) => {
|
|
if (arg0) {
|
|
callback();
|
|
}
|
|
});
|
|
const playWithListenerResult = tmp11Result.playWithListener();
|
|
} else {
|
|
tmp11Result.play();
|
|
}
|
|
return tmp11Result;
|
|
}
|
|
};
|