65 lines
3.4 KiB
TypeScript
65 lines
3.4 KiB
TypeScript
/* Metro module 10756; source: modules/sound_playback/SoundUtils.tsx; dependencies: [10757, 3996, 8900, 3, 10759, 10760, 2] */
|
|
function _fun82740(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#82740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10942:6, offset: 0x01f004d5, size: 228 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const closure = createSound;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const soundpackStore = importDefault(10757) /* metro dependency 10757: SoundpackStore */;
|
|
const streamerModeStore = importDefault(3996) /* metro dependency 3996: StreamerModeStore */;
|
|
const env0_5 = (require(8900) /* metro dependency 8900: Constants */).SoundOutputChannel;
|
|
let value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('SoundUtils');
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/sound_playback/SoundUtils.tsx');
|
|
exports.createSoundForPack = function(a0, a1) {
|
|
var value = a0;
|
|
var value2 = a2;
|
|
var value3 = a3;
|
|
return createSound(importDefault(dependencyMap[4])(a1)[value] ?? value, value,
|
|
value2 !== undefined ? value2 : 1,
|
|
value3 !== undefined ? value3 : SoundOutputChannel.DEFAULT);
|
|
};
|
|
exports.createSound = closure;
|
|
exports.playSound = playSound_82743;
|
|
}
|
|
|
|
function createSound(a0, a1) { // fn#82741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10942:174, offset: 0x01f005b9, size: 107 bytes, params: 3, frame: 19
|
|
let value = a2;
|
|
const value2 = a3;
|
|
const value3 = a4;
|
|
const r6 = value !== undefined ? value : 1;
|
|
const r5 = value2 !== undefined ? value2 : SoundOutputChannel.DEFAULT;
|
|
const r4 = value3 !== undefined ? value3 : false;
|
|
const MobileAudioSound = (require(10760) /* metro dependency 10760: SoundUtils */).MobileAudioSound;
|
|
value = Object.create(MobileAudioSound.prototype, {constructor: {value: MobileAudioSound}});
|
|
const mobileAudioSound = new MobileAudioSound(a0, a1, r6, r5, r4);
|
|
return mobileAudioSound instanceof Object ? mobileAudioSound : value;
|
|
}
|
|
|
|
function playSound_82743(a0) { // fn#82743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10942:509, offset: 0x01f0068e, size: 282 bytes, params: 2, frame: 26
|
|
let value = a0;
|
|
const value2 = a1;
|
|
const value3 = a3;
|
|
const value4 = undefined;
|
|
const r8 = value2 !== value4 ? value2 : 1;
|
|
const env0_0 = a2;
|
|
if (StreamerModeStore.disableSounds) {
|
|
return value4;
|
|
}
|
|
const value8 = (importDefault(10759) /* metro dependency 10759: getSoundsForPack */)(value3 ?? SoundpackStore.getSoundpack());
|
|
if (value8 == null) {
|
|
env0_6.log('Unable to find sound for pack name: ' + value3);
|
|
}
|
|
const createSoundBinding = createSound;
|
|
const r6 = value8[value] ?? value;
|
|
const r5 = (a4 == null ? value4 : a4.outputChannel) ?? SoundOutputChannel.DEFAULT;
|
|
const trackNotificationFailure = a4 == null ? value4 : a4.trackNotificationFailure;
|
|
value = createSoundBinding(r6, value, r8, r5, trackNotificationFailure != null && trackNotificationFailure);
|
|
if (a2 != null) {
|
|
value.playWithListener().then(_fun82744);
|
|
} else {
|
|
value.play();
|
|
}
|
|
return value;
|
|
}
|
|
|