pyfmodex icon indicating copy to clipboard operation
pyfmodex copied to clipboard

`EventInstance.start()` appears to do nothing

Open IzaZed opened this issue 1 year ago • 1 comments

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?

IzaZed avatar Dec 12 '23 13:12 IzaZed

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.

tyrylu avatar Dec 12 '23 18:12 tyrylu

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

IzaZed avatar Apr 25 '24 18:04 IzaZed