utopia-rise / fmod-gdextension

FMOD Studio GDExtension bindings for the Godot game engine
MIT License
480 stars 51 forks source link

FMOD_STUDIO_EVENT_CALLBACK_SOUND_PLAYED returns an empty dict. #272

Open BurAndBY opened 1 week ago

BurAndBY commented 1 week ago

I've recently found this addon and it's really great, but I could not for the life of me figure out how to use callbacks. This code:


func col(_dict: Dictionary, type: int):
    print(_dict, type)

func play_event() -> void:
    if event_instance:
        event_instance.start()
        event_instance.set_callback(col, FmodServer.FMOD_STUDIO_EVENT_CALLBACK_SOUND_PLAYED)

prints out { }8192

and if I turn the col function to have FmodSound as a argument:

func col(_sound: FmodSound, _dict: Dictionary, type: int):
    print(_sound, _dict, type)

the function just does not get called

How do I get the sound returned by the callback?

CedNaru commented 1 week ago

We only have partial support callback events: Currently the ones implemented are

Each event type needs to be manually implemented, so you can tell us what is your use case so we can add it to the next release.

BurAndBY commented 1 week ago

We only have partial support callback events: Currently the ones implemented are

* FMOD_STUDIO_EVENT_CALLBACK_CREATE_PROGRAMMER_SOUND

* FMOD_STUDIO_EVENT_CALLBACK_DESTROY_PROGRAMMER_SOUND

* FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_MARKER

* FMOD_STUDIO_EVENT_CALLBACK_TIMELINE_BEAT

Each event type needs to be manually implemented, so you can tell us what is your use case so we can add it to the next release.

I need this event callback to integrate with code on sound play and this seems to be the way to do it

BurAndBY commented 3 days ago

Hello, any updates on this?

CedNaru commented 3 days ago

We are currently working in a new update, mostly fixing the long list of bugs that were found in the past few months. We also try to add a few new features people are asking for, including yours. It's just take times, our availability is limited. So it's coming, but we don't have an ETA for it yet.

BurAndBY commented 19 hours ago

We are currently working in a new update, mostly fixing the long list of bugs that were found in the past few months. We also try to add a few new features people are asking for, including yours. It's just take times, our availability is limited. So it's coming, but we don't have an ETA for it yet.

That's great to hear. I understand everything takes time. Thanks for your work!