Acessing a function through DisplayServer.tts_set_utterance_callback()?

Godot Version

4.4.1

Question

Hello.


This is my code, and I don’t know what’s wrong with it. I’ve read the docs for callables 30000 times and I still just don’t understand how to use callbacks.
I know by the tone of this it seems like I am throwing shade at Godot, but I ain’t, I’m just stupid sometimes lol.
Everything here seems to be working except the var TTSSOCallable = Callable(self, "ttsSpeechOver")and the DisplayServer.tts_set_utterance_callback(DisplayServer.TTS_UTTERANCE_ENDED, TTSSOCallable). My goal is so when the TTS stops speaking, the function ttsSpeechOver will do its thing.
Thanks to all of those who try to help!

okay, i missed this part:
image
but i do not know how to add the int to the method…

I should imagine you want:

func ttsSpeechOver(utterance_id: int):
    [...]

no yeah, i did that, how do i call it via tts_set_utterance_callback() though? D:

EDIT: oh you dont have to do anything lol, just return to what i posted here! ig i fixed it!

1 Like