WAV sound is null with loadSoundFromPath on the linux target
MasterIO02 opened this issue · 4 comments
Describe the bug
When loading a WAV audio file with loadSoundFromPath on the linux target, the sound is null but on linux-hl the sound plays correctly. The sound loads and plays fine when it's in an Assets folder loaded in the khafile on the linux and linux-hl target.
To Reproduce
Steps to reproduce the behavior:
- Run this Kha project with the linux target (change the path accordingly to where the project is located on the system)
- See audio being null and the app crashing
Expected behavior
The sound is not null and the app doesn't segfault.
Execution Environment:
- Kha revision: dd216e8
The same problem occurs with loadImageFromPath, so I assume it should also occur with all the Assets.load from path functions.
The error is in your code after all, loadSoundFromPath is asynchronous so the callback wasn't necessarily called when you start to use the sound-variable. The HL-implementation is still blocking so that's why it always works there.
Well, that should be stated somewhere. When something works on a specific target but not the other I can't think of anything else than a bug.
Then better not start with graphics-programming 🙃 Anyway, I think the function-signature makes it very clear already but feel free to send a pull-request that adds a comment.