New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request_sound_buffer: condvar wait not supported #406
Comments
This is weird, is |
I will investigate more on my end. during meantime, just to record more details about the error: Attempt to get reference to resource data while it is not loaded! Path is data/sounds/step.wav Parking not supported on this platform', /home/mk8s/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_lot_core-0.9.4/src/thread_parker/wasm.rs:26 |
Aha, you need to wait until the sound is fully loaded, every resource in the engine implements Ideally, you shouldn't request any resources from scripts. You can just add a |
You can just add a sound: Option field to your script and then drag'n'drop a sound from Asset Browser on that field in the Inspector. Did you mean soundbufferresource? also, my script is attached to a rigid body. I did add the option<> field in my script but after restarted the editor, when i check the properties of the rigid body, sound field is not shown for some reason. Update ok, the sound field is now populated with sound source e.g. a wav file. but attempt to playback with following code threw error:let sound = SoundBuilder::new(
=============== |
I managed to reproduce the issue, I'll try to fix it today. |
Alright, it is not an actual issue, it is just quirks of resource management of the engine. When you store a resource_manager
.state()
.containers_mut()
.sound_buffers
.try_restore_optional_resource(&mut self.sound); This is well known issue, and in future versions this method will be replaced with reflection-based solution so you don't need to re-fetch resources anymore. |
I also fixed some other issues that I spotted along the way: missing property editor for sound status in Sound node, and wrong sync order of sound properties. |
I have integrated your code snippet above to look like below. I am getting a different error now:ome/mk8s/.cargo/git/checkouts/fyrox-3b28ccbadb9683b5/4b3093c/fyrox-resource/src/lib.rs:211:17 ========= // restore resource
|
Never mind, i misunderstood the line for restore_resources method. will verify now. |
@mrDIMAS the sound is now working as expected. thanks for the superb assistance. |
I run into this issue with sound manager. code snippet:
resource_manager
.as_ref()
.unwrap()
.request_sound_buffer(path.as_ref())
Just want to confirm that it is not caused by block_on etc. in the codebase.
The text was updated successfully, but these errors were encountered: