Arkadaşlar kodum şu:
İmport speech_recognition as sr.
From datetime import datetime.
From gtts import gtts.
İmport random.
İmport OS.
R = sr.Recognizer()
Mic = sr.Microphone()
With Mic as m:
Audio = r. Listen(m)
Text = r. Recognize_google(Audio, language='TR-TR')
Print(text)
Def text_to_speak(veri):
Tts = gtts(veri, lang='TR')
Rand = random. Randint(1, 1000000)
File = "Audio-"+str(rand)+".MP3"
Tts. Save(file)
Playsaund(file)
OS. Remove(file)
İf "görüşürüz" in text:
Text_to_speak("görüşürüz. اللاقا ")
Elif "merhaba" in text:
Text_to_speak("hoş geldin")
Elif "saat kaç" in text:
text_to_speak(datetime.now().strftime("Saat %H:%M:%S"))
Elif "saat kaç" in text:
text_to_speak(datetime.now().strftime("Saat %H:%M:%S"))
Elif "Türkiye'nin başkenti neresidir" in text:
Text_to_speak("Türkiye cumhuriyetinin başkenti başkenti Ankara'dır.")
Hata:
From gtts import gtts.
File "C:\Users\Mekanik Bey\AppData\Roaming\Python\Python39\site-packages\gtts\__init__.py", line 3, in <module>
From. Tts import gtts, gttserror.
File "C:\Users\Mekanik Bey\AppData\Roaming\Python\Python39\site-packages\gtts\tts.py", line 6, in <module>
From six. Moves import urllib.
Modulenotfounderror: No module named 'six'.
Toplam 0 cevap