FalconPaw
Kilopat
- Katılım
- 5 Eylül 2017
- Mesajlar
- 4.083
- Makaleler
- 8
- Çözümler
- 5
Python'da basit bir asistan yazılımı yaptım. Program sürekli dinliyor, fakat komutları geç algılıyor. Mesela "YouTube aç" dediğim zaman 3-5 saniye sonra açılıyor. Bunu nasıl düzeltirim? Kodlar aşağıda.
[CODE title="asistan"]def dedigimi_ara():
import webbrowser
import time
import speech_recognition as sr
r = sr.Recognizer()
try:
with sr.Microphone() as source:
data = r.listen(source)
print("Sesin tanımlanıyor ))))))")
text = r.recognize_google(data, language = "tr")
dosya = open("text.txt" , "w+" , encoding="utf-8")
dosya.write(text)
dosya = open("text.txt" , "r")
dosya.read()
if "YouTube aç" in text:
webbrowser.open("www.youtube.com.tr")
elif "yemek aç" in text:
webbrowser.open("https://www.yemeksepeti.com/")
elif "getir aç" in text:
webbrowser.open("https://getir.com/kategoriler/")
except:
print("Herhangi bir şey söylemediğiniz için sesiniz tanımlanamadı veya mikrofonunuz yok")
anahtar = 1
while anahtar == 1:
dedigimi_ara()[/CODE]
[CODE title="asistan"]def dedigimi_ara():
import webbrowser
import time
import speech_recognition as sr
r = sr.Recognizer()
try:
with sr.Microphone() as source:
data = r.listen(source)
print("Sesin tanımlanıyor ))))))")
text = r.recognize_google(data, language = "tr")
dosya = open("text.txt" , "w+" , encoding="utf-8")
dosya.write(text)
dosya = open("text.txt" , "r")
dosya.read()
if "YouTube aç" in text:
webbrowser.open("www.youtube.com.tr")
elif "yemek aç" in text:
webbrowser.open("https://www.yemeksepeti.com/")
elif "getir aç" in text:
webbrowser.open("https://getir.com/kategoriler/")
except:
print("Herhangi bir şey söylemediğiniz için sesiniz tanımlanamadı veya mikrofonunuz yok")
anahtar = 1
while anahtar == 1:
dedigimi_ara()[/CODE]