You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm sure I'm doing something very simple wrong here, but it's non-obvious enough that it would be nice to have an example of how to do this properly in pysdl2's excellent docs!
Attached: script creating a Mix_HookMusicFinished callback for music, and a Mix_ChannelFinished for a sound effect (sample/chunk). The music callback works as expected, but the sound callback segfaults running Mix_ChannelFinished - see the comment.
Originally reported by: JP LeBreton (Bitbucket: JPLeBreton, GitHub: JPLeBreton)
I'd like to create a callback when a sound finishes playing, and it doesn't appear to work like anything else I've encountered using pysdl2 so far.
http://www.libsdl.org/projects/SDL_mixer/docs/SDL_mixer.html#SEC37
When I call Mix_ChannelFinished(my_func) where my_func is a standard Python function, I get this error:
My attempt to give it a CFunctionType instance looks like this:
but this gives the error:
I'm sure I'm doing something very simple wrong here, but it's non-obvious enough that it would be nice to have an example of how to do this properly in pysdl2's excellent docs!
The text was updated successfully, but these errors were encountered: