pyfmodex
pyfmodex copied to clipboard
`EventInstance.start()` appears to do nothing
Hi, this is a great resource, so first of all: thank you!
I don't know if this is because the project is still being developed, a bug or me being dense, but with this piece of code:
soundpath = 'path/to/my/banks/'
studio = pyfmodex.studio.StudioSystem()
studio.initialize()
studio.load_bank_file(soundpath + "Master.bank")
studio.load_bank_file(soundpath + "Master.strings.bank")
studio.load_bank_file(soundpath + "sfx.bank")
evt = studio.get_event('event:/Waves').create_instance()
evt.start()
I think I should be able to get a sound playing, but evt.playback_state
always returns STARTING
and no sound is playing, I get no error messages either
Don't worry, I execute the above code once, then in a loop I check the state
Any idea what I'm doing wrong?
No idea, honestly, but because the state changed, the call definitely went through the FFI layer. But yes, I'd expect the same as you.
Hello again, I finally came back to this
I noticed that I get a code 76: STUDIO_NOT_LOADED
error when accessing evt.channel_group
. Apparently the instance never gets fully created but I don't know why
Do you have any ideas?
EDIT: Not calling studio.update()
after starting the sound was the issue, it's working now