decord/source/modules/sound_playback/SoundUtils.tsx

115 lines
3.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10079
// Function ID: 10080
2026-07-29 08:29:29 +00:00
// Name: createSoundForPack
2026-08-24 06:08:38 +00:00
// Dependencies: [10080, 4224, 9694, 3, 10082, 10083, 2]
2026-07-29 08:29:29 +00:00
// Exports: createSound, createSoundForPack, playSound
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 10079 (createSoundForPack)
import timestampDefault from "timestamp" /* 3 */;
import getSoundPackDefault from "getSoundPack" /* 10082 */;
import _createSound from "_createSound" /* 10083 */;
import closure_3 from "Soundpacks" /* 10080 */;
import closure_4 from "initialize" /* 4224 */;
import { SoundOutputChannel } from "SoundOutputChannel" /* 9694 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
let closure_6 = new timestampDefault("SoundUtils");
const tmp2 = new timestampDefault("SoundUtils");
const result = require("set").fileFinishedImporting("modules/sound_playback/SoundUtils.tsx");
2026-07-29 08:29:29 +00:00
export const createSoundForPack = function createSoundForPack(call_calling, soundpack) {
let num = arg2;
if (arg2 === undefined) {
2026-07-20 16:05:17 +00:00
num = 1;
}
2026-07-29 08:29:29 +00:00
let DEFAULT = arg3;
if (arg3 === undefined) {
2026-07-20 16:05:17 +00:00
DEFAULT = SoundOutputChannel.DEFAULT;
}
2026-08-24 06:08:38 +00:00
let tmp3 = getSoundPackDefault(soundpack)[call_calling];
2026-07-29 08:29:29 +00:00
if (tmp3 == null) {
tmp3 = call_calling;
}
if (num === undefined) {
num = 1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (DEFAULT === undefined) {
DEFAULT = SoundOutputChannel.DEFAULT;
}
2026-08-24 06:08:38 +00:00
const mobileAudioSound = new _createSound.MobileAudioSound(tmp3, call_calling, num, DEFAULT, false);
2026-07-20 16:05:17 +00:00
return mobileAudioSound;
2026-07-29 08:29:29 +00:00
};
export const createSound = function createSound(stage_waiting, soundboard_sound, arg2) {
2026-07-20 16:05:17 +00:00
let num = arg2;
if (arg2 === undefined) {
num = 1;
}
2026-07-29 08:29:29 +00:00
let DEFAULT = arg3;
if (arg3 === undefined) {
2026-07-20 16:05:17 +00:00
DEFAULT = SoundOutputChannel.DEFAULT;
}
2026-07-29 08:29:29 +00:00
let flag = arg4;
if (arg4 === undefined) {
flag = false;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const mobileAudioSound = new _createSound.MobileAudioSound(stage_waiting, soundboard_sound, num, DEFAULT, flag);
2026-07-29 08:29:29 +00:00
return mobileAudioSound;
2026-07-20 16:05:17 +00:00
};
export const playSound = function playSound(arg0, arg1, arg2, arg3, outputChannel) {
let num = arg1;
if (arg1 === undefined) {
num = 1;
}
2026-07-29 08:29:29 +00:00
const _require = arg2;
2026-07-20 16:05:17 +00:00
if (!disableSounds.disableSounds) {
let soundpack = arg3;
2026-07-29 08:29:29 +00:00
if (arg3 == null) {
2026-07-20 16:05:17 +00:00
soundpack = soundpack.getSoundpack();
}
2026-08-24 06:08:38 +00:00
const tmp4Result = getSoundPackDefault(soundpack);
2026-07-29 08:29:29 +00:00
if (null == tmp4Result) {
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-08-24 06:08:38 +00:00
logger.log("Unable to find sound for pack name: " + arg3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp13 = tmp4Result[arg0];
if (tmp13 == null) {
tmp13 = arg0;
2026-07-20 16:05:17 +00:00
}
outputChannel = undefined;
2026-07-29 08:29:29 +00:00
if (outputChannel != null) {
2026-07-20 16:05:17 +00:00
outputChannel = outputChannel.outputChannel;
}
2026-07-29 08:29:29 +00:00
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) {
2026-07-20 16:05:17 +00:00
outputChannel = SoundOutputChannel.DEFAULT;
}
2026-07-29 08:29:29 +00:00
if (flag === undefined) {
flag = false;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const mobileAudioSound = new _require(10083).MobileAudioSound(tmp13, arg0, num, outputChannel, flag);
2026-07-20 16:05:17 +00:00
if (null != arg2) {
2026-07-29 08:29:29 +00:00
mobileAudioSound.playWithListener().then((arg0) => {
2026-07-20 16:05:17 +00:00
if (arg0) {
2026-07-23 10:11:24 +00:00
callback();
2026-07-20 16:05:17 +00:00
}
});
2026-07-29 08:29:29 +00:00
const playWithListenerResult = mobileAudioSound.playWithListener();
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
mobileAudioSound.play();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return mobileAudioSound;
2026-07-20 16:05:17 +00:00
}
};