[SOLVED] Sound in Krom

Will the sound ever get fixed in Krom? It has been broken for a long time.

1 Like

Itā€™s reported here https://github.com/armory3d/armory/issues/1396, but Iā€™m not sure if itā€™s an Armory issue or a Krom issue though.

I had the same problem
but it is working for me after I have updated armory SDK to 09

Did you tag the sound with ā€˜fake userā€™?

Screenshot%20from%202019-10-01%2017-55-04

Screenshot%20from%202019-10-01%2018-02-11

edit: only *.wav worked for me

No!
What does it do?:thinking:

Forces the data-block to be linked in Blender, somehow, activating it solved this problem for me.

Iā€™ll try this but we shouldnā€™t have to find a work around

Itā€™s working now, thanks for the help!

2 Likes

is there any checkbox, that would solve the problem with lamps, so I could place more than 4 lights, and spotlights wouldnā€™t cause the low framerate?:smile:

Wow, 4 lights?! I canā€™t use more than 1, haha

My tests with lamps arenā€™t good, occasionally works with me:

  • deleting all lights > cleaning cache > add new lights > compileā€¦ but its random.

Moving and rotating always cause artifacts to me, both forward and deferred render methods.

Consider baking textures and using a single lamp (cause deactivating shadow and/or deleting all light, glitches the frame rate).

Can you share a minimal zip contained project with working sounds for testing purposes? Iā€™m still getting no sound adding fake user onto the platformer templateā€™s sounds from the official repo.

Tested on a ā€œbuildā€ from commit 9b0673d.

Edit: what version of the Armory SDK are you using?

Iā€™m using SDK 1909 and to sound works for me finally.

Not sure from what commit that version is from, but sound is not working in Krom (at least on my end) in the latest version.

Append
the new version is uploaded, Iā€™m going to take a look :relaxed:

A test file, itā€™s contain an embedded sound, you must unpack to work.

To unpack: (this will create a folder in the same directory of this *.blend file)

  • (optional) first create a folder and dropped the blender file into it (to organize the hierarchy)
  • open blender file and click in pointed box (Iā€™m using blender 2.80, this blend file will not work in older versions)
  • choose ā€œUse from current directoryā€ (1st option)
    Screenshot%20from%202019-10-02%2011-50-22

SoundTest.blend (541.4 KB)

If not working in your personal project, try cleaning cache, here sometimes doesnā€™t work and sometimes work without using ā€˜Fake Userā€™.

Overview of the *.blend file:

1 Like

Ok, thanks for the demo project. I can confirm that sound is not working in latest version of the Armory SDK.

Edit: Updating my copy of the armory.py file and updating the SDK with it did the trick, sound is working again on my end! :grin:

If it can help you, I proceed as therafter to get a sound going well when playing on browser or krom.

The main thing is to verify inside the Blender Sound datablock what is referenced as an external or packed sound file, and to use the Data API tool to verify it.

(For exemple : to play this hit1.wav file
image

you can have added a file hit1.wav at time 0 in the sequenceur editor, or as another way to proceed, created a sound folder, used VLC to create a hit1.ogg file (other tools than VLC available to do it tooā€¦) and just copy this hit1.ogg in the folder debug/krom for example to test in krom
image or for test in html in
image
but maybe finnally you donā€™t know really whatā€™s going wrong or not.

Thus using the Data API tool, we can perfectly observe the only important thing, that is
how Blender File Path is set in Blender.

image

because the Play Sound Logic node is going wrong if the class bpy.types.Sound, with itā€™s Sound datablock referencing an external or packed sound file is wrong.

You have the answer when looking the File Path using the Data Api tool available in Blender 2.8

1 Like

You donā€™t need to add a fake user anymore as of ArmorySDK1910 but it still only works with .wav files.

I appreciate all the help, etc. but this should just work (like it was a few versions before)

In theory, khamake compresses the files when making a release build; So donā€™t worry about files being wavā€™s, they will be compressed later on.

It is written here to use .wav or .flac, but is it okay to use a different format?