Non-positional audio.
Moleculor opened this issue ยท 6 comments
Description of the issue:
Audio in Minecraft is, in most cases, positional. That chicken clucking will sound like it's coming from your left if it clucks to the left of you. It will sound distant if it's distant, close if it's close.
Audio in IE is not positional. Send some metal through a metal press while wearing headphones and the sound will come through your headphones equally on both sides no matter which way you're facing. Turn left, turn right, the audio will still come through both headphones equally. Step away and the audio remains equally loud until you pass an arbitrary distance.
The cause of this is because all audio in the mod is saved as stereo, and positional audio must be mono. (Or maybe there's some sort of other solution? But replacing the stereo sounds with mono sounds results in positional audio. The one audio file I checked in vanilla Minecraft (a horse being hurt) was mono, and the one custom sound I tested in another mod that is positional (Minecolonies, an NPC voice) was also mono.)
The fix is to simply change all the audio that should be positional (such as a crusher running, a metal press smashing, etc) to be mono.
Versions & Modlist
Mod List:
ExtraArmor 1.16.4 - 1.1.5.jar |Extra Armor Mod |extraarmor |1.16.4-1.1.3 |DONE |NOSIGNATURE
glasscutter-1.16.3-2.0.0.jar |Glass Harvesters |glasscutter |1.16.3-2.0.0 |DONE |1f:47:ac:b1:61:82:96:b8:47:19:16:d2:61:81:11:60:3a:06:4b:61:31:56:7d:44:31:1e:0c:6f:22:5b:4c:ed
TrashSlot_1.16.3-12.2.1.jar |TrashSlot |trashslot |12.2.1 |DONE |NOSIGNATURE
NetherPortalFix_1.16.3-7.2.1.jar |NetherPortalFix |netherportalfix |7.2.1 |DONE |NOSIGNATURE
Variant16x-1.16.4-v0.17.4.1_beta.jar |Variant16x |variant16x |0.17.4.1_beta |DONE |NOSIGNATURE
DeathCounter-1.16.3-1.2.1.jar |Death Counter |deathcounter |1.2.1 |DONE |NOSIGNATURE
jei-1.16.4-7.6.0.62.jar |Just Enough Items |jei |7.6.0.62 |DONE |NOSIGNATURE
caelus-forge-1.16.4-2.1.0.0.jar |Caelus API |caelus |1.16.4-2.1.0.0 |DONE |NOSIGNATURE
invtweaks-1.16.4-1.0.1.jar |Inventory Tweaks Renewed |invtweaks |1.16.4-1.0.1 |DONE |NOSIGNATURE
Neat 1.7-24.jar |Neat |neat |1.7-24 |DONE |NOSIGNATURE
BetterCaves-1.16.3-1.0.6.jar |YUNG's Better Caves |bettercaves |1.16.3-1.0.6 |DONE |NOSIGNATURE
Waystones_1.16.3-7.3.1.jar |Waystones |waystones |7.3.1 |DONE |NOSIGNATURE
glassential-forge-1.16.4-1.1.5.jar |Glassential |glassential |1.1.5 |DONE |NOSIGNATURE
Clumps-6.0.0.13.jar |Clumps |clumps |6.0.0.13 |DONE |NOSIGNATURE
XaerosWorldMap_1.11.4_Forge_1.16.4.jar |Xaero's World Map |xaeroworldmap |1.11.4 |DONE |NOSIGNATURE
shutupexperimentalsettings-1.0.1.jar |Shutup Experimental Settings! |shutupexperimentalsettings |1.0.1 |DONE |NOSIGNATURE
mgui-1.16.4-3.1.3.jar |mgui |mgui |3.1.3 |DONE |NOSIGNATURE
CookingForBlockheads_1.16.3-9.2.2.jar |Cooking for Blockheads |cookingforblockheads |9.2.2 |DONE |NOSIGNATURE
Controlling-7.0.0.11.jar |Controlling |controlling |7.0.0.11 |DONE |NOSIGNATURE
ReAuth-1.16-Forge-3.9.3.jar |ReAuth |reauth |3.9.3 |DONE |3d:06:1e:e5:da:e2:ff:ae:04:00:be:45:5b:ff:fd:70:65:00:67:0b:33:87:a6:5f:af:20:3c:b6:a1:35:ca:7e
Placebo-1.16.3-4.3.3.jar |Placebo |placebo |4.3.3 |DONE |NOSIGNATURE
comforts-forge-1.16.4-4.0.0.3.jar |Comforts |comforts |1.16.4-4.0.0.2 |DONE |NOSIGNATURE
NaturesCompass-1.16.4-1.8.6.jar |Nature's Compass |naturescompass |1.16.4-1.8.6 |DONE |NOSIGNATURE
netheritehorsearmor-1.6.jar |Netherite Horse Armor Mod |netheritehorsearmor |1.5 |DONE |NOSIGNATURE
ftb-gui-library-1604.1.1.26.jar |FTB GUI Library |ftbguilibrary |1604.1.1.26 |DONE |NOSIGNATURE
BasicNetherOres-1.16.4-5.4.0.jar |Basic Nether Ores |bno |5.4.0 |DONE |NOSIGNATURE
mdecore-1.16.4-16.1.0.jar |MattDahEpic Core |mdecore |16.1.0 |DONE |NOSIGNATURE
curioofundying-forge-1.16.4-5.1.0.0.jar |Curio of Undying |curioofundying |1.16.4-5.1.0.0 |DONE |NOSIGNATURE
Wither-Skeleton-Tweaks-1.16.3-5.2.1.jar |Wither Skeleton Tweaks |wstweaks |5.2.1 |DONE |NOSIGNATURE
FarmingForBlockheads_1.16.3-7.2.1.jar |Farming for Blockheads |farmingforblockheads |7.2.1 |DONE |NOSIGNATURE
Bookshelf-1.16.4-9.3.18.jar |Bookshelf |bookshelf |9.3.18 |DONE |ea:45:b3:82:b6:9d:50:16:95:e7:2e:34:e1:92:d5:b4:9b:69:90:d3:4f:2e:71:99:b0:be:40:80:27:1f:3e:b0
u_team_core-1.16.4-3.1.17.191.jar |U Team Core |uteamcore |3.1.17.191 |DONE |f4:a6:0b:ee:cb:8a:1a:ea:9f:9d:45:91:8f:8b:b3:ae:26:f3:bf:05:86:1d:90:9e:f6:32:2a:1a:ed:1d:ce:b0
Morpheus-1.16.4-4.2.68.jar |Morpheus |morpheus |4.2.68 |DONE |NOSIGNATURE
Hwyla-forge-1.10.11-B78_1.16.2.jar |Waila |waila |1.10.11-B78_1.16.2 |DONE |NOSIGNATURE
WAWLA-1.16.4-7.0.2.jar |WAWLA |wawla |7.0.2 |DONE |ea:45:b3:82:b6:9d:50:16:95:e7:2e:34:e1:92:d5:b4:9b:69:90:d3:4f:2e:71:99:b0:be:40:80:27:1f:3e:b0
Toast-Control-1.16.3-4.3.0.jar |Toast Control |toastcontrol |4.3.0 |DONE |NOSIGNATURE
JustEnoughResources-1.16.4-0.12.0.103.jar |Just Enough Resources |jeresources |0.12.0.103 |DONE |NOSIGNATURE
horsestandstill-1.16.3-1.0.1.jar |Stupid Horse Stand Still |horsestandstill |1.16.3-1.0.1 |DONE |1f:47:ac:b1:61:82:96:b8:47:19:16:d2:61:81:11:60:3a:06:4b:61:31:56:7d:44:31:1e:0c:6f:22:5b:4c:ed
forge-1.16.4-35.1.13-universal.jar |Forge |forge |35.1.13 |DONE |22:af:21:d8:19:82:7f:93:94:fe:2b:ac:b7:e4:41:57:68:39:87:b1:a7:5c:c6:44:f9:25:74:21:14:f5:0d:90
shetiphiancore-1.16-3.8.4.jar |ShetiPhian-Core |shetiphiancore |3.8.4 |DONE |NOSIGNATURE
PackMenu-1.16.3-2.3.0.jar |Pack Menu |packmenu |2.3.0 |DONE |NOSIGNATURE
CraftingTweaks_1.16.3-12.2.0.jar |Crafting Tweaks |craftingtweaks |12.2.0 |DONE |NOSIGNATURE
DiceMC-TieredArmor-1.16.4-1.0.jar |DiceMC Tiered Armor |dicemcta |1.16.4-1.0 |DONE |NOSIGNATURE
forge-1.16.4-35.1.13-client.jar |Minecraft |minecraft |1.16.4 |DONE |NOSIGNATURE
mcw-bridges-1.0.4-mc1.16.4.jar |Macaw's Bridges |mcwbridges |1.0.4 |DONE |NOSIGNATURE
useful_backpacks-1.16.4-1.11.6.86.jar |Useful Backpacks |usefulbackpacks |1.11.6.86 |DONE |f4:a6:0b:ee:cb:8a:1a:ea:9f:9d:45:91:8f:8b:b3:ae:26:f3:bf:05:86:1d:90:9e:f6:32:2a:1a:ed:1d:ce:b0
repurposed_structures-1.16.4-2.3.3.jar |Repurposed Structures |repurposed_structures |1.16.4-2.3.3 |DONE |NOSIGNATURE
keeptherain-0.1.3.jar |Keep The Rain |keeptherain |0.1.3 |DONE |NOSIGNATURE
EnchantmentDescriptions-1.16.4-6.0.2.jar |EnchantmentDescriptions |enchdesc |6.0.2 |DONE |ea:45:b3:82:b6:9d:50:16:95:e7:2e:34:e1:92:d5:b4:9b:69:90:d3:4f:2e:71:99:b0:be:40:80:27:1f:3e:b0
MouseTweaks-2.13-mc1.16.2.jar |Mouse Tweaks |mousetweaks |2.13 |DONE |NOSIGNATURE
crashutilities-3.7.jar |Crash Utilities |crashutilities |3.7 |DONE |NOSIGNATURE
ImmersiveEngineering-1.16.4-4.1.2-129.jar |Immersive Engineering |immersiveengineering |1.16.4-4.1.2-129 |DONE |44:39:94:cf:1d:8c:be:3c:7f:a9:ee:f4:1e:63:a5:ac:61:f9:c2:87:d5:5b:d9:d6:8c:b5:3e:96:5d:8e:3f:b7
SilentLib-1.16.3-4.9.0+63.jar |Silent Lib |silentlib |4.9.0+63 |DONE |NOSIGNATURE
durability101-1.16-0.0.3.jar |Durability101 |durability101 |0.0.3 |DONE |NOSIGNATURE
valhelsia_structures-16.0.5.jar |Valhelsia Structures |valhelsia_structures |16.0.5 |DONE |NOSIGNATURE
RapidLeafDecay-1.16.4-1.0.0.jar |Rapid Leaf Decay |rapid_leaf_decay |1.0.0 |DONE |NOSIGNATURE
Autofish-0.9.1-forge-mc1.16.4.jar |Autofish |autofish |0.9.1 |DONE |NOSIGNATURE
ceramicbucket-2.5.2-1.16.2+.jar |Ceramic Bucket |ceramicbucket |2.5.2-1.16.2+ |DONE |NOSIGNATURE
simplylight-1.16.4-1.1.1.jar |Simply Light |simplylight |1.16.4-1.1.1 |DONE |NOSIGNATURE
simplefarming-1.16.4-1.3.5.jar |Simple Farming |simplefarming |1.16.4-1.3.5 |DONE |NOSIGNATURE
Ding-1.16.3-1.2.0.jar |Ding |ding |1.2.0 |DONE |NOSIGNATURE
ceilingtorch-1.16.2-v1.8.jar |Ceiling Torch |ceilingtorch |v1.8 |DONE |NOSIGNATURE
ceramicshears-1.3.2-1.16.1+.jar |Ceramic Shears |ceramicshears |1.3.2-1.16.1+ |DONE |NOSIGNATURE
jeiintegration_1.16.4-6.1.1.11.jar |JEI Integration |jeiintegration |6.1.1.11 |DONE |NOSIGNATURE
curios-forge-1.16.4-4.0.3.0.jar |Curios API |curios |1.16.4-4.0.3.0 |DONE |NOSIGNATURE
tetra-1.16.4-3.3.1.jar |Tetra |tetra |3.3.1 |DONE |NOSIGNATURE
betconduitpl_1.16.4-1.1.jar |Better Conduit Placement |betconduitpl |1.1 |DONE |NOSIGNATURE
Xaeros_Minimap_20.29.1_Forge_1.16.4.jar |Xaero's Minimap |xaerominimap |20.29.1 |DONE |NOSIGNATURE
collective-1.16.4-1.53.jar |Collective |collective |1.53 |DONE |NOSIGNATURE
TorchBandolier-1.16.3-1.5.1+11.jar |Torch Bandolier |torchbandolier |1.5.1+11 |DONE |NOSIGNATURE
StorageDrawers-1.16.3-8.2.1.jar |Storage Drawers |storagedrawers |8.2.1 |DONE |NOSIGNATURE
tombstone-1.16-6.2.0.jar |Corail Tombstone |tombstone |1.16-6.2.0 |DONE |NOSIGNATURE
globaldataandresourcepacks-1.16.4-1.7.3.jar |Global Data- & Resourcepacks |globaldataandresourcepacks |1.16.4-1.7.3 |DONE |NOSIGNATURE
structurize-0.13.104-ALPHA-universal.jar |Structurize |structurize |0.13.104-ALPHA |DONE |NOSIGNATURE
AmbientEnvironment-4.0.0.6.jar |Ambient Environment |ambientenvironment |4.0.0.6 |DONE |NOSIGNATURE
minecolonies-0.13.532-ALPHA-universal.jar |Minecolonies |minecolonies |0.13.532-ALPHA |DONE |NOSIGNATURE
[1.16.1-1.16.4][Forge]TorchBowMod_v1.4.jar |TorchBowMod |torchbowmod |1.4 |DONE |NOSIGNATURE
AppleSkin-mc1.16.2-forge-1.0.14.jar |AppleSkin |appleskin |1.0.14 |DONE |NOSIGNATURE
curiouselytra-forge-1.16.3-4.0.0.1.jar |Curious Elytra |curiouselytra |1.16.3-4.0.0.1 |DONE |NOSIGNATURE
connectedglass-1.0.6-mc1.16.4.jar |Connected Glass |connectedglass |1.0.6 |DONE |NOSIGNATURE
moreoverlays-1.18.11-mc1.16.4.jar |More Overlays Updated |moreoverlays |1.18.11-mc1.16.4 |DONE |NOSIGNATURE
durabilityviewer-1.16.4-forge35.0.7-1.10.jar |Giselbaers Durability Viewer |durabilityviewer |1.16.4-forge35.0.7-1|DONE |NOSIGNATURE
cloth-config-forge-4.1.1.jar |Cloth Config v4 API |cloth-config |4.0 |DONE |NOSIGNATURE
byg-1.1.5.jar |Oh The Biomes You'll Go |byg |1.1.5 |DONE |NOSIGNATURE
betterbedrockgenerator-1.16.4-0.1.2.jar |Better Bedrock Generator |betterbedrockgenerator |0.1.2 |DONE |NOSIGNATURE
CraftableHorseArmour-1.16.X-1.4.0.jar |CHA&S - Craftable Horse Armour|craftablehorsearmour |1.16.4-1.4.0 |DONE |NOSIGNATURE
FastLeafDecay-v25.jar |FastLeafDecay |fastleafdecay |v25 |DONE |NOSIGNATURE
CosmeticArmorReworked-1.16.4-v1.jar |CosmeticArmorReworked |cosmeticarmorreworked |1.16.4-v1 |DONE |5e:ed:25:99:e4:44:14:c0:dd:89:c1:a9:4c:10:b5:0d:e4:b1:52:50:45:82:13:d8:d0:32:89:67:56:57:01:53
ServerTabInfo-1.16.4-1.3.3.jar |Server Tab Info |servertabinfo |1.3.3 |DONE |NOSIGNATURE
BetterMineshafts-Forge-1.16.3-1.1.1.jar |YUNG's Better Mineshafts |bettermineshafts |1.16.3-1.1.1 |DONE |NOSIGNATURE
WailaHarvestability-mc1.16.2-forge-1.1.13.jar |Waila Harvestability |wailaharvestability |1.1.13 |DONE |NOSIGNATURE
supertools-1.16.3-3.jar |Vanilla+ Tools |supertools |version |DONE |NOSIGNATURE
BetterAdvancements-1.16.4-0.1.0.103.jar |Better Advancements |betteradvancements |0.1.0.103 |DONE |NOSIGNATURE```
Feel free to make a pullrequest then, with the respective files changed to mono channel.
I didn't do so (yet?) for several reasons, and have questions about how to approach this.
- I don't have the original audio files (if these aren't them). Starting from the originals may(?) result in a higher quality end result, but that depends on what the original audio files were. It's possible what's stored in the
.jar
is good enough, or even equal to the originals. (Also wasn't sure if I had permission to use the stuff in the.jar
.) - I've never actually forked, done a pull request, or... whatever other steps are required. For code, even, much less data files. So I don't know how. ๐ (I'm eventually going to need to learn, so this might as well be the way I do so? It'll take me a bit of time.)
- I don't actually know enough about all the various places/ways the audio files are used to know if they should all be positional or not. I've never actually progressed fully through IE. I always get distracted by other games. Some of these sounds I've never even heard.
- And finally, audio balancing. To give an example, making the diesel generator mono provides great audio positioning in game. It also makes it much, much quieter even just a few blocks away. This impacts other sounds as well. A quick glance at the code suggests the diesel generator might currently be playing at only 50% volume, if I'm understanding the code correctly, so this might be easily fixable, but I haven't gone through to look at the volume of every sound, nor do I know if you'd want/be comfortable with a positional audio change being accompanied by changes to volume settings.
I can make some educated guesses about audio content, but don't want to guess incorrectly.
I see in the audio.json there are several sound categories.
- Block
- Diesel Generator
- Crusher
- Metal Press
- Tesla Coil
- Breaker Switch
- ...chutes? (I didn't realize those made a sound.)
- Neutral
- "Birthday Party"
- Revolver Fire
- This also includes Gun Turrets, I think? But do turrets use the 'thump' or 'reload'?
- "Charge fast" and "Charge slow" - Are these rail gun charging sounds? Are they used anywhere else?
- "Spark" Where are these used?
- Railgun Fire
- Skyhook
- Player
- Spray
- Spray Fire (I'm guessing these two are chemthrower stuff?)
My vague understanding is that these are the volume sliders these sounds are assigned to?
Now, I can clearly see that the items under the Block category can likely safely be made positional. Those are all obviously blocks, both by category and by name. I doubt these sounds (through intuition?) are used elsewhere, so it's safe to change these.
But the others are less clear.
Birthday party: Is this audio played for everyone who sees a zombie kid get taken out with a headshot? Or just the player who takes the shot? If it's everyone, positional might make more sense. If it's just the player, then no. Alternatively/additionally, earning the achievement might be better with a non-positional Birthday Party, but then all subsequent be positional? For best quality in that case, you'd want two different versions of the file: one stereo for the non-positional, one mono for the party happening at the zombie's corpse. (To clarify, changing this audio to mono does have the cheering children sound like they're coming from the burst of sparkles where the zombie dies.)
Revolver Fire - Oooh boy, this one's a bit more technical:
So both the revolver and the turret use this sound. (This suggests that it might be wise to split revolvers and turrets within the JSON, put the revolver in the player category, the turret in the block category, but have them both pointing to the same audio file?)
Right now if I make it positional, that improves the turret by having its fire be positional but it leaves an odd effect for the revolver where the audio is 'left behind' by a moving player. So if you're moving, it will play the audio where you were rather than a more believable 'always with you' kind of sound. The 'click' of an empty revolver (which is apparently Subtitled as a note block, so I suspect that's what the click actually is?) sticks with you and isn't left behind, which suggests that these two audio playbacks are performed by different kinds of function calls? And the player-firing-a-revolver one would probably benefit to being changed over to whatever function that happens to be?
Also, what is 'thump'?
Spark: Are these both the tesla coil and a railgun holding a charge? If so, same story as Revolver Fire.
Charge fast and slow: Are these just the railgun? Or are they used elsewhere?
Skyhook: This one's already mono, I think, and since I've only experienced it in single-player currently seems to sound 'fine'? Can anyone other than the player using the skyhook hear this one? Actually, never mind, maybe best not to address or even look at Skyhook, since it seems to have an entire file and set of code dedicated to playing its audio?
Spray and Spray Fire: Same story as Revolver Fire, I suspect?
- Charge fast/slow is railgun. Spark is when you keep it charged, it keeps sprazzling. Same sound is also use by teslacoils.
- Thump is high explosive rounds in the revolver.
- The Spray ones are from the chemthrower.
The category set in the JSON don't actually matter, as far as I am aware, since we chose the playback category when playing? And yes, the revolver does use noteblock sounds for certain things. It used to be all vanilla sounds until I reworked it.
I'll save myself explaining git stuff to you, since you seem to have figured it out. That said, I am still on holiday, and will only get to review this in the new year.
That said, I am still on holiday, and will only get to review this in the new year.
I'm pretty sure audio in IE has been non-positional for years. It's been non-positional since at least 1.12, probably 1.10. It can wait a few weeks/months. ๐ Take all the time you want.
Besides, the (first?) pull request doesn't even address all of the sounds. I'm starting out with small steps.
It looks like the sound categories are no longer set in the JSON - it's not mentioned on the wiki and the code doesn't read it.
I did a little more digging and discovered that, at least in one case, vanilla Minecraft actually uses the stereo=non-positional, mono=positional reality as a feature. Minecarts have two different sound files: a stereo one that they play when you are riding in the cart, and a mono one they play for a cart moving past you.
Pretty sure they both play simultaneously for the player in the cart when you're in the cart. Which I think might technically be possible to stop from happening if they wanted to? I suspect it would sound nicer if they did, since you can sorta hear the positional audio under the non-positional audio being 'left behind' you as you move, since the position the sound is played at is static and not attached to the triggering... entity? Entity's the word, I think?
I'm definitely still on "baby steps" for modding, but I was looking at Forge documentation and saw there are several different ways that different sounds might be played for different people based on who they are? So for a revolver, the player holding and firing the gun could hear the current stereo sound file, and everyone else could probably hear a mono version? Resulting in the gunfire sounding 'correct' for everyone: non-positional for the player firing, positional for everyone nearby.
Maybe? I really am still pretty new at this. Haven't actually written code yet. Might be a half-decent starter project for me in a while, maybe.