Giselbaer's Durability Viewer

Giselbaer's Durability Viewer

3M Downloads

Custom sound issue

shouxd opened this issue ยท 4 comments

commented

When I replace tool_breaking with a 2 seconds custom .ogg sound (same name as mentioned in mod page) a high pitched version of said sound is played in Minecraft instead of the original.

commented

hey @gbl, sorry for not getting back earlier! :c

I've commited the broken file in jemand771@25d9974
You can take a look at it locally by either adding my repo as a remote or just re-cloning it alltogether. (url: https://github.com/jemand771/DurabilityViewer.git) Check out the branch alternate-custom-sound and build the thing.
Alternatively, you can just download this file and put it into your jar

commented

Oh, almost forgot to mention: for me, replacing the sound playback parameters with the value 100 with 1.0f fixes the issue. I don't know anything about minecraft modding/the fabric API though, so I'm not sure if this is "correct" or just coincidentally fixes it.
Affected line:

MinecraftClient.getInstance().player.playSound(sound, 100, 100);

I'm not creating a PR yet since I'm not sure if you'd want to backport this change to earlier versions of the mod

commented

i thought this was related to the audio file's bitrate, but it's not - i get the same issue with a custom 48kHz file as when i encode it down to the 22050Hz that the original file has

commented

Can you upload / link that file somewhere? I'm just using the standard Minecraft way of playing a sound file, so it has to have to do something with the file, but I can't really check into that without an example.