def set_endevent(eventtype=None):
    global _endmusic_event

    if eventtype is None:
        eventtype = SDL_NOEVENT
    _endmusic_event = eventtype
Have the music send an event when playback stops.
dataset/ETHPy150Open los-cocos/cocos/cocos/audio/pygame/music.py/set_endevent