当我调用我的函数时,我没有错误,但如果我重复调用它,我将出现以下错误:
发生异常:PermissionError [Errno 13] 权限被拒绝:'tolkback.mp3'
from gtts import gTTS
import pyglet
from playsound import playsound
def TalkBack(case_ans):
print("in ...................................")
tts = gTTS(case_ans)
tts.save('tolkback.mp3')
print("saving...............................")
playsound('tolkback.mp3')
print("saying................................")
TalkBack("my bad end 1")
TalkBack("go go end 2")
TalkBack("find me my self end 3")
TalkBack("games maker end 4")
TalkBack("say my name end 5")
程序应该回话文本