def bubble_class_1(): goToNextBubble = False scene_3.scene_3() speech.speech(20,10) print("speaking bubble")
def left_convo_2(): goToNextBubble = False scene_2.scene_2() speech.speech(10,150) print("left bubble")
def bubble_tree_1(): goToNextBubble = False scene_4.scene_4a() speech.speech(20,100) print("speaking bubble")
def upcomingShows(): tts.speak('would you like all concerts or a specific artist') print('would you like all concerts or a specific artist') print('---------------------') # concertType = input() concertType = speech.speech() print(concertType) if ('concert' in concertType): # getting all upcoming concerts tts.speak('Specify a location') print('specify a location') print('---------------------') # city = input() city = speech.speech() tts.speak('Is there a limit you would like to set on the results') print('Is there a limit you would like to set on the results') print('---------------------') # limit = input() limit = speech.speech() if ('no' in limit): uc.concertCall('all', city, '40') else: uc.concertCall('all', city, limit) else: # getting artist specific concerts tts.speak('what artist would you like?') print('what artist would you like') print('---------------------') # artistCall = input() artistCall = speech.speech() uc.concertCall(artistCall, None, None)
def name(message): n = message names={1:['hello,{0}!'.format(n), 'sweet name {0}!'.format(n), 'it\'s my pleasure to meet you {0}'.format(n)] } namee = random.choice(names[1]) namee = namee.upper() print(bot.format(namee)) speech.speech(namee)
def main_flow(): similar_artist_keyword = ['similar', 'like', 'artist', 'artists'] upcoming_shows_keyword = [ 'concert', 'concerts', 'shows', 'gig', 'gigs', 'show', 'event' ] upcoming_albums_keyword = [ 'albums', 'new', 'album', 'release', 'releases', 'records' ] reminder_keyword = ['reminder', 'notification', 'notify'] audioclip_keyword = ['preview', 'clip', 'track', 'sample'] tts.speak('Saylem activated') print('Saylem activated') tts.speak("What would you like?") print('What would you like?') print('---------------------') # query = input() query = speech.speech() while query not in similar_artist_keyword + upcoming_albums_keyword + upcoming_shows_keyword + reminder_keyword + audioclip_keyword: tts.speak('query not found. Please try again') # query = input query = speech.speech() print(query) # take the input apart and look for keywords for i in query.split(' '): if (i in similar_artist_keyword): # similar artists keyword found similarArtist() tts.speak( 'Query Finished. Submit another query if you would like.') elif (i in upcoming_shows_keyword): # upcoming concerts keyword found upcomingShows() tts.speak( 'Query Finished. Submit another query if you would like.') elif (i in upcoming_albums_keyword): # getting new albums keyword found upcomingAlbums() tts.speak( 'Query Finished. Submit another query if you would like.') elif (i in reminder_keyword): # reminders keyword found reminders() tts.speak( 'Query Finished. Submit another query if you would like.') elif (i in audioclip_keyword): # audio clip keyword found audioClip() tts.speak( 'Query Finished. Submit another query if you would like.') else: # no keyword found tts.speak('query not found')
def similarArtist(): tts.speak('what artist') print('what artist?') print('---------------------') # artist = input() artist = speech.speech() tts.speak('how many results would you like') print('how many results would you like') print('---------------------') # limit = input() limit = speech.speech() tts.speak('artists that are similar to ' + artist + ' are...') print('artists that are similar to ' + artist + ' are...') print('---------------------') sa.call(artist, limit)
def reminders(): tts.speak('What artist would you like to set a reminder for') print('What artist would you like to set a reminder for') # remindArtist = input() remindArtist = speech.speech() tts.speak('What is the venue') print('What is the venue') # remindVenue = input() remindVenue = speech.speech() tts.speak('What is the date. Specify in date month format') print('What is the date. Specify in date month format') # remindDate = input() remindDate = speech.speech() reminder.setReminder(remindDate, remindArtist, remindVenue) tts.speak('Your reminder has been set')
def whatsapp(t): x=0 t+=1 users= w.find_elements_by_class_name("_1582E") for i in users: try: m=i.find_element_by_class_name("_31gEB") i.click() time.sleep(2) messages=i.find_element_by_class_name("_2iq-U") s=messages.get_attribute("title") print(s) sent=speech.speech(s) print(s) try: sentMessage(sent) except Exception as e: print(e) x=1 except: if(x==1): i.click() if t==60: w.refresh() wait = WebDriverWait(w, 600) time.sleep(3) return t
def __init__(self): self.filename = os.path.join(os.path.expandvars("%appdata%"), "latex-access.conf") self.speech_translator = speech.speech() self.preprocessor = preprocessor.preprocessor() self.activateSettings() self.newcommands = preprocessor.newcommands(self.preprocessor)
def fun_1(): t1.delete(0, 'end') t1.insert(0, speech.speech()) a = t1.get() ## l.delete('1.0', END) ## l.insert(INSERT,scrap.wiki(a)) if 'who' in a or 'when' in a: l.delete('1.0', END) l.insert(INSERT, scrap.google(a)) speech.voice(scrap.google(a)) elif 'about' in a or 'About' in a: a = a[6:] l.delete('1.0', END) l.insert(INSERT, scrap.wiki(a)) speech.voice(scrap.wiki(a)) elif 'what is the' in a: a = a[12:] l.delete('1.0', END) l.insert(INSERT, scrap.wiki(a)) speech.voice(scrap.wiki(a)) elif 'what is' in a: a = a[8:] l.delete('1.0', END) l.insert(INSERT, scrap.wiki(a)) speech.voice(scrap.wiki(a)) else: l.delete('1.0', END) l.insert(INSERT, scrap.wiki(a)) speech.voice(scrap.wiki(a))
def __init__(self, confFile="~/.alvi.cfg"): try: from speech import speech except: print "Speech Syntesys not found!!!" try: import speech_recognition as sr except: print "Speech Recognition not Found!!!!" self.speech = speech() self.say = self.speech.say self.loadConf(confFile) self.say("I am loading") self.loadConf(confFile) self.loadBrain() self.say("I have been uploaded sir, ready to go.") self.loadCommandSet() # DirtyFix for stderr os.close(2)
def audioClip(): tts.speak('what artist would you like to hear a clip of?') print('what artist') # audioClipArtist = input() audioClipArtist = speech.speech() tts.speak('Audio preview of ' + audioClipArtist + ' starting now.') tts.speak('Please wait a moment while it loads') ap.getUrl(audioClipArtist)
def robotBrain(): while(1): txt = speech() control = 'sudo python robot.py "{0}"'.format(txt) print(control) os.system(control) if( 'stop' in txt): break
def translate(l): translate = Translator() if l == '': TTS('要翻譯成什麼語言', '中文') l = speech('要翻譯成什麼語言', 2, 2) TTS('我正在聽', '中文') say = speech('我正在聽', 2, 2) #say = '你好嗎' result = translate.translate(say, dest=lan.get(l)) #result = translate.translate(say ,dest=lan.get('日文')) #result = translate.translate('我想吃晚餐',dest=lan.get('日文')) #speak(result.text,lan.get(l)) TTS(result.text, l) #print (result.text) return result.text
def intro(): print(bot.format('WELCOME !!! TO \"SRI ESHWAR COLLEGE OF ENGINEERING\"')) speech.speech('WELCOME !!! TO \"SRI ESHWAR COLLEGE OF ENGINEERING\"') video.video() print(bot.format('MYSELF LAKMÉ, AN AUTOMATED MESSAGING CHATBOT')) speech.speech('MYSELF LAKMÉ, AN AUTOMATED MESSAGING CHATBOT') print(bot.format('WHAT IS YOUR NAME?')) speech.speech('WHAT IS YOUR NAME') name.name(input('USER :'******'YOU CAN CLEAR YOUR DOUBT\'S WITH ME.......')) speech.speech('YOU CAN CLEAR YOUR DOUBT\'S WITH ME.......')
def capture(n): cap = cv2.VideoCapture(0) print(bot.format('ENTER \"q\" TO CAPTURE AND SAVE')) speech.speech('ENTER \"q\" TO CAPTURE AND SAVE') while True: return_value, image = cap.read() gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) cv2.imshow('image', gray) if cv2.waitKey(1) & 0xFF == ord('q'): cv2.imwrite('pic_' + n + '.jpg', image) break cap.release() cv2.destroyAllWindows() imgplot = plt.imshow(mpimg.imread('pic_' + n + '.jpg')) plt.show() print(bot.format('PHOTO SAVED SUCCESSFULLY...........')) speech.speech('PHOTO SAVED SUCCESSFULLY...........') form.form(n)
def send(): speech.voice("To whom") a = speech.speech() print("done") speech.voice("mail") body = speech.speech() print("done") msg = MIMEMultipart() msg["From"] = fromadd msg["To"] = a msg["Subject"] = "Senf by manibalan" msg.attach(MIMEText(body, "plain")) mail = msg.as_string() server = smtplib.SMTP("smtp.gmail.com", "587") server.ehlo() server.starttls() server.login(fromadd, "findmeufuck") server.sendmail(fromadd, a, mail) server.quit()
def main(): tts.speak('Saylem initialized. Say my name when you would like to start') print('Saylem initialized. Say my name when you would like to start') print('---------------------') start = speech.speech() # start = input() print(start) reminder.checkForReminder() if ('Sale' or 'Salem' in start): main_flow()
def add_hobbies(self): print("Which hobby would you like to add?") in_loop = True while in_loop: hobby = speech() print("You said '" + hobby + "'. Is that correct?") command = speech() if (any(command in w for w in APPROVAL_LIST)): hobby_list = self.hobby_list hobby_list.append({"name": hobby}) user_data = get_data_from_file("users.json") for user in user_data['users']: if(user['name'] == self.name): user['hobbies'] = hobby_list dump_data_to_file(user_data, "users.json") in_loop = False elif (any(command in w for w in CANCEL_LIST)): in_loop = False
def right_convo_2(): goToNextBubble = False scene_2.scene_2() speech.speech(900, 150) print("right bubble")
speech_pay_phrase = 0 payment_state = 0 # 0 - no money, 1 - part of money, 2 - enough money last_magic_time = time.time() - 2*dconfig.payment_afterpay_time # last time of prediction last_far_time = time.time() - 2 * (dconfig.repeat_time_far / 1000) # last time of speech when user is far last_close_time = time.time() - 2 * (dconfig.repeat_time_close / 1000) # last time of speech when user is close last_close_state_time = time.time() - 2 * dconfig.user_gone_timeout / 1000 last_far_state_time = time.time() - 2 * dconfig.user_gone_timeout / 1000 # camera_object = camera.camera() hand_object = hand.hand() breathing_object = breathing.breathing() speech_object = speech.speech() led_payment_object = led.led(dconfig.led_payment_pin, dconfig.led_payment_period) led_lamp_object = led.led(dconfig.led_lamp_pin, 0) led_waiting_object = led.led(dconfig.led_waiting_pin, 0) led_magic_object = led.led(dconfig.led_magic_pin, 0) led_card_object = led.led(dconfig.led_card_pin, 0) motion_detector_object = motion_detector.motion_detector( dconfig.motion_detector_pin, dconfig.motion_detector_power_pin) card_dispenser_object = card_dispenser.card_dispenser() money_acceptor_object = money_acceptor.money_acceptor() gsm_object = gsm.gsm(money_acceptor_object, card_dispenser_object) ups_object = ups.ups(gsm_object) super_button_object = super_button.SuperButton(speech_object, led_lamp_object, led_magic_object, hand_object) super_button_object.activate_button()
from random import randint import time import sys import os from speech import speech def delay_print(s): for c in s: sys.stdout.write(c) sys.stdout.flush() time.sleep(0.04) name = speech("What is your name") name = name.replace(' ','') if name == '': name = 'Player_One' computer_score = 0 player_score = 0 rule = 0 no = 0 none = 0 t = 0 yessir = 0 rules = ''' Welcome to rockpaper.py, a simple game of rock paper scissors. The rules are simple. You will choose either a rock, paper, or scissors. Simultaneously, I will randomly choose a guess as well. Then we will compare.
def post(key): if key == '頭條': all_news(headlines()) elif key == '關鍵字': all_news(articles(speech('請說出要搜尋的關鍵字', 2, 1)))
from random import randint import time import sys import os from speech import speech def delay_print(s): for c in s: sys.stdout.write(c) sys.stdout.flush() time.sleep(0.04) name = speech("What is your name") name = name.replace(' ', '') if name == '': name = 'Player_One' computer_score = 0 player_score = 0 rule = 0 no = 0 none = 0 t = 0 yessir = 0 rules = ''' Welcome to rockpaper.py, a simple game of rock paper scissors. The rules are simple. You will choose either a rock, paper, or scissors.
import speech import capture import respond import responses bot = 'LAKMÉ : {0}' user = '******' intro.intro() while True: message = input('USER : '******'exit': print(bot.format('DO YOU LIKE TO FILL ADMISSION FORM (y/n)')) speech.speech('DO YOU LIKE TO FILL ADMISSION FORM') a = input('USER : '******'Y' or a == 'y': print('NAME PLEASE :') speech.speech('NAME PLEASE') r = input('USER : '******'THANK YOU FOR SPENDING TIME WITH US (- | -)!!!')) speech.speech('THANK YOU FOR SPENDING TIME WITH US (- | -)!!!') break else: response = respond.receive_message(responses.responses, message) response = response.upper() print(bot.format(response)) speech.speech(response)
# -*- coding: utf-8 -*- import os, sys sys.path.append('../Mecab') sys.path.append('../Tools') sys.path.append('../pretreatment') sys.path.append('../nounExtract') sys.path.append('../compoundAnalysis') import pretreatment, mecab, Tools, nounExtract import likelihood import speech # fromFilepath = "/home/dreamer/documents/code/database/conference/ryoin11-29/" # fromFilepath = "/home/dreamer/documents/code/database/conference/sanngiinn11-29/" fromFilepath = "/home/dreamer/documents/code/database/conference/syugiinn11-29.zip/" toFilepath = "./pretreatment/" # pretreatment.eachFile(fromFilepath, toFilepath) # fromFilepath = "/home/dreamer/documents/code/database/conference/sanngiinn11-29/" # toFilepath = "./includeKeyword/" # nounExtractFilePath = './nounExtractFile/' # nounExtract.eachFile(toFilepath,nounExtractFilePath) toFilepath = './nounExtractFile/' allWord = './allWord/allWord.txt' # likelihood.generateAllWords(toFilepath,allWord) # likelihood.generateMecabList('./allWord/','allWord.txt','./allWord/') newfile = './speechAndWords3.txt' speech.speech("./allWord/TwoAndThree.txt", newfile)
def main(): print("What") y = s.speech(1, "") print(y.toString())
print(""" Option 1: Get Date Option 2: Get Cal Option 3: Open cheese and take photo Option 4: Take photo and save Option 5: Open Firefox Option 6: Set Static Ip Option 7: Custom command Option 8: Install python3 and opencv """) message = "cd ." #int(input("Enter the choice :")) print("enter your choice :") try: choice = speech() except: choice = speech() print(choice) if (choice == 3 or choice == 4 or choice == 5): print(ssh_connect(username)) graphical_execution(choice, username) clientsock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) clientsock.sendto(message.encode(), (ip, port)) time.sleep(1) else: message = decode_choice(choice, username) clientsock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) clientsock.sendto(message.encode(), (ip, port)) time.sleep(1)
def __init__(self): self.detector = hotword.hotword() self.speaker = speech.speech() self.speaker.speak(u'안녕하세요') self.speaker.speak(u'하루를 시작합니다..')
# Used for communication via pyymacs from within emacs. # Written by Daniel Dalton <*****@*****.**> """Silly hack to access translate functions as pymacs was difficult to interact with classes.""" import sys import os.path import settings import speech import nemeth import ueb import preprocessor import matrix_processor import table as t s = speech.speech() n = '' p = preprocessor.preprocessor() nc = preprocessor.newcommands(p) matrix = matrix_processor.matrix() matrix.row = 1 matrix.column = 1 if __name__ == "__main__": print "This is just a module." exit(-1) def activateSettings(): """Activate the latex-access settings stored in file.
import speech, owobot, subprocess, os, signal running = False while True: desired_func = input( 'Type 1 for speech and 2 for normal op. To run 2 async, type 3. To kill realbot, type 4. >>' ) if desired_func == '1': speech.speech() elif desired_func == '2': owobot.owobot() elif desired_func == '3': proc = subprocess.Popen('python3 eggbot/owobot.py', stdout=subprocess.PIPE, shell=True, preexec_fn=os.setsid) running = True elif desired_func == '4': if running: os.killpg(os.getpgid(proc.pid), signal.SIGTERM) print('Killed process.') else: print("Realbot wasn't running!") elif desired_func == 'EXIT': break else: print('no bueno bitchboy')
from speech import speech from spotify_playback_control import * from weather import getweather from translate import * from News import * temp_status = False if playing_status() == True: temp_status = playing_status() spotifycontrol("暫停") command = speech("嗨!", 2, 1) if command == "音樂": subcommand = speech("請輸入指令:", 2, 2) if temp_status == True: resume() spotifycontrol(subcommand) elif command == "翻譯": translate(speech('請選擇要翻譯的語言', 2, 3), speech('正在翻譯...', 2, 2)) if temp_status == True: resume() elif command == "天氣": getweather() if temp_status == True: resume() elif command == "新聞": post(speech('請選擇搜尋方式', 2, 2)) if temp_status == True: resume() else: print("...")