![]() ![]() ![]() ') else: speak('I unable to give answer of your question') GitHub - Rynkll696/HH: import pyttsx3 import speech_recognition as sr import datetime from datetime import date import calendar import time import math import wikipedia import webbrowser import os import smtplib import winsound import pyautogui import cv2 from pygame import mixer from tkinter import * import ssagebox as message from sqlite3 import * conn = connect("voice_assistant_asked_questions.db") conn.execute("CREATE TABLE IF NOT EXISTS `voicedata`(id INTEGER PRIMARY KEY AUTOINCREMENT,command VARCHAR(201))") conn.execute("CREATE TABLE IF NOT EXISTS `review`(id INTEGER PRIMARY KEY AUTOINCREMENT, review VARCHAR(50), type_of_review VARCHAR(50))") conn.execute("CREATE TABLE IF NOT EXISTS `emoji`(id INTEGER PRIMARY KEY AUTOINCREMENT,emoji VARCHAR(201))") global query engine = pyttsx3.init('sapi5') voices = engine.getProperty('voices') tProperty('voice', voices.id) def speak(audio): engine.say(audio) nAndWait() def wishMe(): hour = int(().hour) if hour >= 0 and hour= 12 and hour = 200: speak('Your voice is pretty good!') elif ' ' in query: try: #query = query.replace("what is ","") results = wikipedia.summary(query, sentences=3) print(results) speak(results) except Exception as e: speak('I unable to answer your question.') elif 'a' in query or 'b' in query or 'c' in query or 'd' in query or 'e' in query or 'f' in query or 'g' in query or 'h' in query or 'i' in query or 'j' in query or 'k' in query or 'l' in query or 'm' in query or 'n' in query or 'o' in query or 'p' in query or 'q' in query or 'r' in query or 's' in query or 't' in query or 'u' in query or 'v' in query or 'w' in query or 'x' in query or 'y' in query or 'z' in query: try: results = wikipedia.summary(query, sentences = 2) print(results) speak(results) except Exception as e: speak('I unable to answer your question. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |