I’m building a basic text to audio app using python.When I play an audio file after taking an input from a user and clicking a button, the window closes after the audio file is played.
app = CTk()
app.title("Text to Morse Code")
app.geometry("600x400")
def gui_handler():
def input_to_morse():
morse_code = text_to_morse(entry.get())
morse_audio = morse_to_audio(morse_code)
threading.Thread(target=play, args=(morse_audio,)).start()
print("Hello")
gen_morse_button = CTkButton(app, text="Generate Morse Code", command=input_to_morse)
entry = CTkEntry(app, placeholder_text="Enter text to be converted")
app.grid_columnconfigure(0, weight=1)
entry.grid(row=0, column=0, padx=40, pady=20, sticky="ew")
gen_morse_button.grid(row=1, column=0, padx=40, pady=20, sticky="ew")
gui_handler()
app.mainloop()
This is the exit code for when the window closes.
Process finished with exit code 139 (interrupted by signal 11:SIGSEGV)
I looked this up and it says some sort of segmentation error but I’m not sure how to fix it. I’ve tried using simple audio where I export the file from pydub and played it using simple audio but it’s the same issue.