def openAudio(): global audioDeviceActive if audioDeviceActive: return movie.stop() # if not call it, Mix_OpenAudio will failed after movie playing finish if Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 1024) < 0: core.raisesdlerr() audioDeviceActive = True
def openAudio(): global audioDeviceActive if audioDeviceActive: return movie.stop( ) #if not call it, Mix_OpenAudio will failed after movie playing finish if Mix_OpenAudio( MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 1024, ) < 0: core.raisesdlerr() audioDeviceActive = True
def exitapp(*args): if args: logerr(*args) global screen if screen: sdl.SDL_FreeSurface(screen) screen = None movie.stop() music.closeAudio() sdl.Mix_Quit() #if not call will abort sdl.IMG_Quit() sdl.TTF_Quit() sdl.SDL_Quit() exitproc()