[SOLVED] Armory weird problem with sound

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 :slight_smile:

1 Like

@ QuantumCoderQC: I cannot see the trait assigned anywhere. Also when i disconnect the keyboard from play sound, compile and reconnect it, it magically does not work anymore and i can´ t figure out how to restore it without freshly unpacking your file. So please, what kind of hoodoo voodoo have you done?

Hi,

The trait is assigned to the Scene

I’m not sure why this happens and I cannot reproduce it. A few things to consider:

  1. Make sure that your audio file is in the Bundled folder
  2. When you make changes to the node tree, clean the project once before compiling:

image

Thanks, that did the job. Second case seems to be related to my Bluetooth connection and pulse audio. Not a good combination and buggy as hell. Stability seems to depend on the sequence one uses, when installing the components.