Pygame Mixer "Fatal Python error: (pygame parachute) Segmentation Fault" Error

Viewed 157

Example;

from pygame import mixer
import threading
import time

def sound(file_path):
    mixer.init()
    mixer.music.load(file_path)
    mixer.music.play()
    while mixer.music.get_busy():
        time.sleep(0.1)
    mixer.stop()
    mixer.quit()

while True:
    file_path = input("Enter your file path:")
    threading.Thread(target=sound,args={file_path}).start()

Sometimes when i run this code i get the following error:

Fatal Python error: (pygame parachute) Segmentation Fault

Whats wrong in here?

0 Answers
Related