How to free resource in PyGame mixer?
I use gTTS python module to get mp3 from Google Text-To-Speech API and PyGame to play output mp3 files without opening external player (is there any simpler way to do it?) However it seems like PyGame mixer doesn't free file resource, even after it's quit method. phrase = "Hello!" tts = gtts.gTTS(text=phrase, lang='en') tts.save("googleTTS.mp3") f = MP3("googleTTS.mp3") mixer.init(f.info.sample_rate) mixer.music.load("googleTTS.mp3") mixer.music.play() while mixer.music.get_busy() == True: continue mixer.quit() # doesn't free resource? phrase = "Bye!" tts = gtts.gTTS(text=phrase, lang='en')