This is now fixed for the HL targets in Kha, but Armory is not yet updated to the latest Kha version (so it might take a while until the fix is included): [HL] some sample rate fixes by MoritzBrueckner · Pull Request #1383 · Kode/Kha · GitHub. On Krom the issue still persists, but I will try to find a fix as soon as possible.
To be precise, the pitch in the workaround you described should probably be old_pitch * (44100 / 48000)
. 48000 is the sample rate that Haxe “thinks” Krom uses although it probably uses 44100, which is why you get the wrong pitch.
If you know Haxe, you can simply change the sound’s playback samplerate to 40516 = 44100 * (44100 / 48000) for sounds with an original sample rate of 44100. Some example code can be found here (have a look at lines 9-10, 39 and 46). Note that this workaround will result in wrong pitch on all other targets without this issue, so make sure to wrap everything inside of #if kha_krom
blocks if you export to multiple targets.
But hopefully this is all fixed soon so you don’t even need that workaround