entry e giriken verii ses çevimek istedim program gayet güzel bir şekilde çalışıyor lakin arada aşağıdaki hatayı veriyor(hata verdiğindede kod çalışıyor)
sorun ne olabilir??
from gtts import gTTS
from playsound import playsound
import os
import tkinter as tk
class root(tk.Tk):
def __init__(self):
super().__init__()
self.entry = tk.Entry()
self.entry.place(x=10, y=10)
self.button = tk.Button(text="ok", command=self.fonk, width=15)
self.button.place(x=10, y=50)
def fonk(self):
voice = gTTS(text=self.entry.get(), lang="tr", slow=False)
file = "answer.mp3"
voice.save(file)
playsound(file)
os.remove(file)
root().mainloop()
Error 263 for command:
open answer.mp3
Bu, kaydedilmiş bir MCI aygıtı değil.
Error 263 for command:
close answer.mp3
Bu, kaydedilmiş bir MCI aygıtı değil.
Failed to close the file: answer.mp3
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\toshiba\AppData\Local\Programs\Python\Python39\lib\tkinter\__init__.py", line 1892, in __call__
return self.func(*args)
File "C:\Users\toshiba\Desktop\pythonproje\pyroidhesapmakinesi(yeni).py", line 22, in fonk
playsound(file)
File "C:\Users\toshiba\AppData\Local\Programs\Python\Python39\lib\site-packages\playsound.py", line 72, in _playsoundWin
winCommand(u'open {}'.format(sound))
File "C:\Users\toshiba\AppData\Local\Programs\Python\Python39\lib\site-packages\playsound.py", line 64, in winCommand
raise PlaysoundException(exceptionMessage)
playsound.PlaysoundException:
Error 263 for command:
open answer.mp3
Bu, kaydedilmiş bir MCI aygıtı değil.