Sound issue: Custom mob's sounds ignore it's position and proximity to player

Started by gopnick on Sun, 07/19/2020 - 14:39

Topic category: Help with modding (Java Edition)

Last seen on 04:56, 8. Sep 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Sound issue: Custom mob's sounds ignore it's position and proximity to player
Sun, 07/19/2020 - 14:39

Hello!

I created custom mob and added sounds to it: living, hurt and death. But in the game I noticed that sounds don't play from the mob's position, they play like global sounds (like game music or menu clicks).

To describe this better I recorded 50 second video. Please use headphones to understand this issue. In the video I spawn vanilla pigs and my mobs, so you can compare how they sound. Pig's souds change volume depending on player's position. They also have this "3D effect", you can say that pig is behind your back just by it's sound. But my custom mob does not sound like this, it has the same volume and does not have 3D effect, it feels like it sound happens just in between my ears. Sound volume and "source" is the same if mob is in front or behind, close or away.

I really would like to fix this because this makes mob interaction weird. Any idea how to make custom mob sounds work like vanilla mob sounds? Thanks in advance! :) 

Last seen on 01:02, 19. Jun 2021
Joined May 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
YES! This has bothered me…
Thu, 08/27/2020 - 19:09

YES! This has bothered me ever since I started making mods on MCreator. It's been like this for ages with really no word on what the problem actually is, and if it's even something the end user can fix. I have no idea what causes this problem, and even going into custom code I was unable to make the sound play in stereo ingame. This needs to be fixed.

Last seen on 04:56, 8. Sep 2020
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hey rmsandegs I found a fix…
Thu, 08/27/2020 - 19:26

Hey rmsandegs I found a fix for that. It is a file format issue. At first I used Audacity to convert mp3 and wav sound files to ogg, but it didn't work properly. After that I tried different programs and one made right file that plays stereo.

I am not on my working PC now and can't remember what program I used. Will be able to add more details tomorrow. Hopefully you can wait for another day :D 

Last seen on 01:02, 19. Jun 2021
Joined May 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Oh, wow. Thanks so much! I'm…
Thu, 08/27/2020 - 20:26

Oh, wow. Thanks so much! I'm also using Audacity so there's a high chance we had the same issue.

Last seen on 01:02, 19. Jun 2021
Joined May 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I figured out the reason…
Sun, 09/06/2020 - 21:54

I figured out the reason. Looking through all of Minecraft's sound files, I noticed they were all saved as mono files with only one sound channel (instead of stereo with 2 channels, one for each ear). I think this is the reason why all of my sounds, which were all exported in stereo, always play in both ears with no spacial awareness.