Asistan Sürüm 2

import time
import random
import datetime
import webbrowser
import speech_recognition as sr
from speech_recognition import RequestError, UnknownValueError


nasılsın = ["nasılsın","nasıl gidiyor","merhaba","hey"]
nasılsın_cevap = ["iyi senden","bu gün çok kötüyüm","çok üzügünüm"]
arama = ["arama","arama yap","ara","bir şey ara"]
müzik = ["müzik","müzik aç","müzik çal"]
saat = ["saat kaç","saat","saati söyle"]
hava = ["hava nasıl","hava","hava durumu"]
lig = ["fikstür","maç","puan durumu","puan"]
kapat = ["kapan","kapat","hoşçakal","güle güle","bye bye","by by"]
navigasyon = ["nereden nereye","navigasyon","nasıl gidebilirim"]
takvim = ["bu gün ayın kaçı","bu gün günlerden ne","takvim"]
çeviri = ["çeviri","çeviriyi aç","translati aç"]
hesap = ["hesap makinesini aç","hesap makinesi"]
youtube = ["youtube da arama yap","video aç","youtube"]
wikipedia = ["wikipedia yı aç","araştırma yap"]
discord = ["discord u aç","discord"]

print("""
----------------------------------------------------------------
        SİSTEMİN KABUL ETTİĞİ KELİMELER

SELAMLAŞMA İÇİN -> nasılsın,nasıl gidiyor,merhaba,hey

ARAMA YAPABİLMEK İÇİN -> arama,arama yap,ara,bir şey ara

MÜZİK ÇALMAK İÇİN -> müzik,müzik aç,müzik çal

SAAT İÇİN -> saat kaç,saat,saati söyle

HAVA İÇİN -> hava nasıl,hava,hava durumu

LİG İÇİN -> fikstür,maç,puan durumu,puan

NAVİGASYON -> nereden nereye,navigasyon,nasıl gidebilirim

TAKVİM -> bu gün ayın kaçı,bu gün günlerden ne,takvim

ÇEVİRİ -> çeviri,çeviriyi aç,translati aç

HESAP MAKİNESİ İÇİN -> hesap makinesini aç,hesap makinesi

YOUTUBE İÇİN -> youtube da arama yap,video aç,youtube

WİKİPEDİA İÇİN -> wikipedia yı aç,araştırma yap

KAPATMAK İÇİN -> kapan,kapat,hoşçakal,güle güle,bye bye,by by

DİSCORD(EK ÖZELLİK) İÇİN -> discord u aç,discord
----------------------------------------------------------------
""")



print("Konuş")

time.sleep(5)


r = sr.Recognizer()

def record():
    with sr.Microphone() as mic:
        audio = r.listen(mic)
        ses = " "
        try:
            ses = r.recognize_google(audio , language="tr-TR")
        except UnknownValueError:
            print("Anlayamadım")

        except RequestError:
            print("Sistem Çalışmıyor")
    return ses

def response(ses):
    if ses in arama:
        b = record("Ne Arayacaksınız:")
        url = "https://www.google.com/search?q=" + b
        webbrowser.get().open(url)

    elif ses in nasılsın:
        random.choice(nasılsın_cevap)

    elif ses in saat:
        an = datetime.datetime.now()
        tarih = datetime.datetime.ctime(an)
        print(tarih)

    elif ses in müzik:
        ac = record("Spotify mı Yotube Müzik mi (Spotify için spotify Youtube Müzik için youtubemüzik): ").lower()
        if ac == "spotify":
            webbrowser.open("https://accounts.spotify.com/tr/login/?continue=https:%2F%2Fwww.spotify.com%2Fapi%2Fgrowth%2Fl2l-redirect&_locale=tr-TR")

        elif ac == "youtube müzik":
            webbrowser.open("https://music.youtube.com")

    elif ses in hava:
        il = record("Hangi İlde Bulunmaktasınız: ")
        url_a = "https://www.mgm.gov.tr/tahmin/il-ve-ilceler.aspx?il=" + il
        webbrowser.get().open(url_a)

    elif ses in lig:
        webbrowser.open("https://www.tff.org/default.aspx?pageID=198")

    elif ses in kapat:
        exit()

    elif ses in navigasyon:
        webbrowser.open("https://www.google.com/maps/dir///@39.0876459,35.1777724,6z?hl=tr")

    elif ses in takvim:
        webbrowser.open("http://takvim.ufgu.com/")

    elif ses in çeviri:
        webbrowser.open("https://translate.google.com")

    elif ses in hesap:
        webbrowser.open("https://www.google.com/search?sxsrf=ALeKk00y8t1CE2zrR0UWUoDMk_OlFlUK0Q%3A1605034600797&ei=aOKqX-mZMM2IrwSciJjwBg&q=hesap+makinesi&oq=hesap+makinesi&gs_lcp=CgZwc3ktYWIQAzIECCMQJzIECCMQJzIECCMQJzIFCAAQsQMyBAgAEEMyAggAMgIIADICCAAyAggAMgIIADoECAAQR1COiAFYjogBYKeNAWgAcAJ4AIABqgGIAaoBkgEDMC4xmAEAoAEBqgEHZ3dzLXdpesgBCMABAQ&sclient=psy-ab&ved=0ahUKEwjp7e3p0_jsAhVNxIsKHRwEBm4Q4dUDCA0&uact=5")

    elif ses in youtube:
        aranacak=record("Ne Aramak İstiyorsunuz?:")
        webbrowser.open("https://www.youtube.com/results?search_query={}".format(aranacak))

    elif ses in wikipedia:
        aranacak=record("Ne Aramak İstiyorsunuz?:")
        webbrowser.open("https://tr.wikipedia.org/w/index.php?search={}&title=%C3%96zel%3AAra&go=Git".format(aranacak))

    elif ses in discord:
        webbrowser.open("https://discord.com/login")

    else:
        print("Hatalı Giriş")


while True:
    islem = input("Nasıl Yardımcı Olabilirim:")
    if islem in arama:
        d = input("Ne Arayacaksınız:")
        url = "https://www.google.com/search?q=" + d
        webbrowser.get().open(url)
        

    elif islem in nasılsın:
        random.choice(nasılsın_cevap)
        

    elif islem in saat:
        an_1 = datetime.datetime.now()
        tarih_1 = datetime.datetime.ctime(an_1)
        print(tarih_1)
        

    elif islem in müzik:
        ac_1 = input("Spotify mı Yotube Müzik mi (Spotify için spotify Youtube Müzik için youtubemüzik): ").lower()
        if ac_1 == "spotify":
            webbrowser.open("https://accounts.spotify.com/tr/login/?continue=https:%2F%2Fwww.spotify.com%2Fapi%2Fgrowth%2Fl2l-redirect&_locale=tr-TR")

        elif ac_1 == "youtube müzik":
            webbrowser.open("https://music.youtube.com")

    elif islem in hava:
        il = input("Hangi İlde Bulunmaktasınız: ")
        url_a = "https://www.mgm.gov.tr/tahmin/il-ve-ilceler.aspx?il=" + il
        webbrowser.get().open(url_a)

    elif islem in lig:
        webbrowser.open("https://www.tff.org/default.aspx?pageID=198")

    elif islem in kapat:
        exit()

    elif islem in navigasyon:
        webbrowser.open("https://www.google.com/maps/dir///@39.0876459,35.1777724,6z?hl=tr")

    elif islem in takvim:
        webbrowser.open("http://takvim.ufgu.com/")

    elif islem in çeviri:
        webbrowser.open("https://translate.google.com")

    elif islem in hesap:
        webbrowser.open("https://www.google.com/search?sxsrf=ALeKk00y8t1CE2zrR0UWUoDMk_OlFlUK0Q%3A1605034600797&ei=aOKqX-mZMM2IrwSciJjwBg&q=hesap+makinesi&oq=hesap+makinesi&gs_lcp=CgZwc3ktYWIQAzIECCMQJzIECCMQJzIECCMQJzIFCAAQsQMyBAgAEEMyAggAMgIIADICCAAyAggAMgIIADoECAAQR1COiAFYjogBYKeNAWgAcAJ4AIABqgGIAaoBkgEDMC4xmAEAoAEBqgEHZ3dzLXdpesgBCMABAQ&sclient=psy-ab&ved=0ahUKEwjp7e3p0_jsAhVNxIsKHRwEBm4Q4dUDCA0&uact=5")

    elif islem in youtube:
        aranacak=input("Ne Aramak İstiyorsunuz?:")
        webbrowser.open("https://www.youtube.com/results?search_query={}".format(aranacak))

    elif islem in wikipedia:
        aranacak=input("Ne Aramak İstiyorsunuz?:")
        webbrowser.open("https://tr.wikipedia.org/w/index.php?search={}&title=%C3%96zel%3AAra&go=Git".format(aranacak))

    elif islem in discord:
        webbrowser.open("https://discord.com/login")

    else:
        print("Hatalı Giriş")
        while True:
            islem = input("Nasıl Yardımcı Olabilirim:")
            if islem in arama:
                d = input("Ne Arayacaksınız:")
                url = "https://www.google.com/search?q=" + d
                webbrowser.get().open(url)
        

            elif islem in nasılsın:
                e = random.choice(nasılsın_cevap)
                print(e)
        
            elif islem in saat:
                an_1 = datetime.datetime.now()
                tarih_1 = datetime.datetime.ctime(an_1)
                print(tarih_1)
        
            elif islem in müzik:
                ac_1 = input("Spotify mı Yotube Müzik mi (Spotify için spotify Youtube Müzik için youtubemüzik): ").lower()
                if ac_1 == "spotify":
                    webbrowser.open("https://accounts.spotify.com/tr/login/?continue=https:%2F%2Fwww.spotify.com%2Fapi%2Fgrowth%2Fl2l-redirect&_locale=tr-TR")

                elif ac_1 == "youtube müzik":
                    webbrowser.open("https://music.youtube.com")

            elif islem in hava:
                il = input("Hangi İlde Bulunmaktasınız: ")
                url_a = "https://www.mgm.gov.tr/tahmin/il-ve-ilceler.aspx?il=" + il
                webbrowser.get().open(url_a)

            elif islem in lig:
                webbrowser.open("https://www.tff.org/default.aspx?pageID=198")

            elif islem in kapat:
                exit()

            elif islem in navigasyon:
                webbrowser.open("https://www.google.com/maps/dir///@39.0876459,35.1777724,6z?hl=tr")

            elif islem in takvim:
                webbrowser.open("http://takvim.ufgu.com/")

            elif islem in çeviri:
                webbrowser.open("https://translate.google.com")

            elif islem in hesap:
                webbrowser.open("https://www.google.com/search?sxsrf=ALeKk00y8t1CE2zrR0UWUoDMk_OlFlUK0Q%3A1605034600797&ei=aOKqX-mZMM2IrwSciJjwBg&q=hesap+makinesi&oq=hesap+makinesi&gs_lcp=CgZwc3ktYWIQAzIECCMQJzIECCMQJzIECCMQJzIFCAAQsQMyBAgAEEMyAggAMgIIADICCAAyAggAMgIIADoECAAQR1COiAFYjogBYKeNAWgAcAJ4AIABqgGIAaoBkgEDMC4xmAEAoAEBqgEHZ3dzLXdpesgBCMABAQ&sclient=psy-ab&ved=0ahUKEwjp7e3p0_jsAhVNxIsKHRwEBm4Q4dUDCA0&uact=5")

            elif islem in youtube:
                aranacak=input("Ne Aramak İstiyorsunuz?:")
                webbrowser.open("https://www.youtube.com/results?search_query={}".format(aranacak))

            elif islem in wikipedia:
                aranacak=input("Ne Aramak İstiyorsunuz?:")
                webbrowser.open("https://tr.wikipedia.org/w/index.php?search={}&title=%C3%96zel%3AAra&go=Git".format(aranacak))

            elif islem in discord:
                webbrowser.open("https://discord.com/login")
            
            else:
                continue


1 Beğeni

Hem Konuşabilirsiniz Hem Yazabilirsiniz. Konuşmayı algılama da sıkıntı olduğu için yazabilme özelliğini de ekledim

belirli hatalar vardı gözümden kaçmış yazı kısmında bazı yerler record olunca sıkıntı çıktı

şimdi sen burada ne yaptın bir program mı tanıttın eğer tanıttıysan program-tanıtımları adında bir etiket var onu da yazına eklersen çok daha iyi olur. ayrıca bu programın kodlarını paylaşma onun yerine onu dosya şeklinde paylaş. Bir de bu programı konsol üzerinden yapma grafikal bir program olsun tkinter kullanma istersen çok ilkel bir yapısı var.

mesajları toast olarak verebilirsin

toast nedir ki acaba

win 10 da sağdan çıkan bildirimler

Ben basit bir şey istedim arayüzlüsü üzerinde çalışıyoruz

Ara yüzde işlemler sadece yazıyla olacak sonradan konuşmayı ekliyeceğim
@hackaxx denedün mi kodu bende ses algısında sorun var

peki arayüz için tkinter mi PyQT mi kullanacaksın

Pyqt 5

bu arada ui dosyalarını kullanarak nasıl arayüz tasarlanıyor bir söyler misin

Py ye dönüştürüp from dosya ismi imğort Ui Main Windıw diyorsun

peki tamam o zaman ben bir ara araştırayım

Bu senin sesini algıladı mı

Denedin ni ben de 2 3 dk bekletiyor

C:\Users\Casper>pip install speech_recognition
ERROR: Could not find a version that satisfies the requirement speech_recognition (from versions: none)
ERROR: No matching distribution found for speech_recognition
WARNING: You are using pip version 20.2.3; however, version 20.2.4 is available.
You should consider upgrading via the ‘c:\python39\python.exe -m pip install --upgrade pip’ command.

C:\Users\Casper>

pip install SpeechRegonition @hackaxx

C:\Users\Casper>pip install SpeechRegonition
ERROR: Could not find a version that satisfies the requirement SpeechRegonition (from versions: none)
ERROR: No matching distribution found for SpeechRegonition
WARNING: You are using pip version 20.2.3; however, version 20.2.4 is available.
You should consider upgrading via the ‘c:\python39\python.exe -m pip install --upgrade pip’ command.

C:\Users\Casper>

pip install SpeechRecognition @hackaxx yanlış yazmışın kusura bakma