Audio related update trying to track down why some sounds aren't playing properly/too fast.

This commit is contained in:
Woah 2021-03-25 15:32:26 -04:00
parent 0b498fc455
commit 98450d84a1
14 changed files with 72 additions and 67 deletions

View file

@ -0,0 +1,37 @@
package org.runite.client;
public final class AudioHandler {
static int currentSoundEffectCount = 0;
static int soundEffectVolume = 127;
public static void musicHandler(int var1) {
try {
if (-1 == var1 && !Class83.aBoolean1158) {
GameObject.method1870();
} else if (var1 != -1 && (Class129.anInt1691 != var1 || Class79.method1391(-1)) && Unsorted.anInt120 != 0 && !Class83.aBoolean1158) {
Unsorted.method2099(var1, CacheIndex.musicIndex, Unsorted.anInt120);
}
Class129.anInt1691 = var1;
} catch (RuntimeException var3) {
throw ClientErrorException.clientError(var3, "li.B(" + true + ',' + var1 + ')');
}
}
static void soundEffectHandler(int soundEffectID, int soundEffectDelay, int soundEffectVolume) {
try {
if(soundEffectVolume != 0 && soundEffectID != 0 && currentSoundEffectCount < 50 && soundEffectDelay != -1) {
Class166.anIntArray2068[currentSoundEffectCount] = soundEffectID;
Class3_Sub25.anIntArray2550[currentSoundEffectCount] = soundEffectDelay;
Unsorted.anIntArray2157[currentSoundEffectCount] = soundEffectVolume;
Class102.aClass135Array2131[currentSoundEffectCount] = null;
Class3_Sub8.anIntArray3083[currentSoundEffectCount] = 0;
currentSoundEffectCount++;
}
} catch (RuntimeException var5) {
throw ClientErrorException.clientError(var5, "ca.C(" + soundEffectID + ',' + soundEffectDelay + ',' + soundEffectVolume + ',' + -799 + ')');
}
}
}