decord/source/modules/sound_playback/SoundUtils.tsx
github-actions 67d978d9fb chore: update source for alpha 346.0
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9672_m.js (378.6 MB)
2026-09-07 16:44:02 +00:00

114 lines
3.3 KiB
TypeScript

// Module ID: 9907
// Function ID: 9908
// Name: createSoundForPack
// Dependencies: [9908, 4405, 9096, 3, 9910, 9911, 2]
// Exports: createSound, createSoundForPack, playSound
// Module 9907 (createSoundForPack)
import timestampDefault from "timestamp" /* 3 */;
import getSoundPackDefault from "getSoundPack" /* 9910 */;
import _createSound from "_createSound" /* 9911 */;
import closure_3 from "Soundpacks" /* 9908 */;
import closure_4 from "initialize" /* 4405 */;
import { SoundOutputChannel } from "SoundOutputChannel" /* 9096 */;
require = arg1;
let closure_6 = new timestampDefault("SoundUtils");
const tmp2 = new timestampDefault("SoundUtils");
const result = require("set").fileFinishedImporting("modules/sound_playback/SoundUtils.tsx");
export const createSoundForPack = function createSoundForPack(call_calling, soundpack) {
let num = arg2;
if (arg2 === undefined) {
num = 1;
}
let DEFAULT = arg3;
if (arg3 === undefined) {
DEFAULT = SoundOutputChannel.DEFAULT;
}
let tmp3 = getSoundPackDefault(soundpack)[call_calling];
if (tmp3 == null) {
tmp3 = call_calling;
}
if (num === undefined) {
num = 1;
}
if (DEFAULT === undefined) {
DEFAULT = SoundOutputChannel.DEFAULT;
}
const mobileAudioSound = new _createSound.MobileAudioSound(tmp3, call_calling, num, DEFAULT, false);
return mobileAudioSound;
};
export const createSound = function createSound(stage_waiting, soundboard_sound, arg2) {
let num = arg2;
if (arg2 === undefined) {
num = 1;
}
let DEFAULT = arg3;
if (arg3 === undefined) {
DEFAULT = SoundOutputChannel.DEFAULT;
}
let flag = arg4;
if (arg4 === undefined) {
flag = false;
}
const mobileAudioSound = new _createSound.MobileAudioSound(stage_waiting, soundboard_sound, num, DEFAULT, flag);
return mobileAudioSound;
};
export const playSound = function playSound(arg0, arg1, arg2, arg3, outputChannel) {
let num = arg1;
if (arg1 === undefined) {
num = 1;
}
const _require = arg2;
if (!disableSounds.disableSounds) {
let soundpack = arg3;
if (arg3 == null) {
soundpack = soundpack.getSoundpack();
}
const tmp4Result = getSoundPackDefault(soundpack);
if (null == tmp4Result) {
const _HermesInternal = HermesInternal;
logger.log("Unable to find sound for pack name: " + arg3);
}
let tmp13 = tmp4Result[arg0];
if (tmp13 == null) {
tmp13 = arg0;
}
outputChannel = undefined;
if (outputChannel != null) {
outputChannel = outputChannel.outputChannel;
}
if (outputChannel == null) {
outputChannel = SoundOutputChannel.DEFAULT;
}
let flag;
if (outputChannel != null) {
flag = outputChannel.trackNotificationFailure;
}
if (flag == null) {
flag = false;
}
if (num === undefined) {
num = 1;
}
if (outputChannel === undefined) {
outputChannel = SoundOutputChannel.DEFAULT;
}
if (flag === undefined) {
flag = false;
}
const mobileAudioSound = new _require(9911).MobileAudioSound(tmp13, arg0, num, outputChannel, flag);
if (null != arg2) {
mobileAudioSound.playWithListener().then((arg0) => {
if (arg0) {
callback();
}
});
const playWithListenerResult = mobileAudioSound.playWithListener();
} else {
mobileAudioSound.play();
}
return mobileAudioSound;
}
};