# return(row[1]) if counter == number - 1: return (row[1]) counter = counter + 1 # sentence = get_csv_text(0) # sys.argv[1] means any number passed here as a string sentence = get_csv_text(int(sys.argv[1])) print("what is sys.argv? " + str(sys.argv[1]) + " " + str(type(sys.argv[1]))) print(sentence) # print("saying:", sys.argv[1]) # sys.argv[1] is the number of the sentence to say # grab the sentence from csv file here: # ohbot.setVoice("-ven+croak") # ohbot.setVoice("-vfr+f1 -p99 -s180") # https://github.com/ohbot/ohbot-python # ohbot.setVoice("-ven-us -a200 ") # ohbot.say(sentence) ohbot.setVoice("-ven-us+f2") # ohbot.say(sentence) # # say the sentence ohbot.say(sentence)
# -s for speed 80 to 500 # -p for pitech 0 to 99 # ESPEAK-NG # supports some of the ESPEAK but some is missing # import the ohbot module from ohbot import ohbot # Reset Ohbot ohbot.reset() # Default synthesizer SAPI. Default Voice as set in Control Panel ohbot.say("I. I just took a ride") # Quieter ohbot.setVoice("-a82") ohbot.say("In a silver machine.") # Faster ohbot.setVoice("-r4") ohbot.say("And I'm still feeling mean.") # Slower ohbot.setVoice("-r-4") ohbot.say("Do you wanna ride? See yourself going by.") # American ohbot.setVoice("-vzira") ohbot.say("The other side of the sky.") # Default voice ohbot.setVoice("") ohbot.say("I got a silver machine.") # Switch to espeak-ng - some of the voice attributes aren't supported
def get_steven_to_talk(): """Run the Ohbot routine Returns: Boolean True or False depending on whether run successfully or not """ try: # Reset Ohbot ohbot.reset() # Switch the speech synthesizer to epseak ohbot.setSynthesizer("espeak") # Set the voice to english West Midlands accent medium speed. ohbot.setVoice("-ven+f2 -s130") # Set eyes to red ohbot.eyeColour(10, 0, 0) ohbot.wait(0.5) # Say something ohbot.say("Good Evening", True, False, False, 0) ohbot.wait(0.5) #ohbot.say("Who have we got here",True, False, False,0) #ohbot.wait(0.5) ohbot.say("I'm the late great Mary Webb ", True, False, False, 0) ohbot.wait(0.5) ohbot.say("I love children ", True, False, False, 0) ohbot.wait(0.5) ohbot.say("For supper", True, False, False, 0) ohbot.wait(0.5) #ohbot.say("Woooahhhh woooahhha",True, False, False,0) #ohbot.wait(0.5) # Wait a few seconds for the motors to move ohbot.wait(2) # Move head left to right ohbot.move(ohbot.HEADTURN, 4, 1) ohbot.wait(0.5) ohbot.move(ohbot.HEADTURN, 6, 1) ohbot.wait(0.5) ohbot.move(ohbot.HEADTURN, 5, 1) ohbot.wait(0.5) ohbot.eyeColour(0, 10, 0) ohbot.wait(0.5) ohbot.move(ohbot.HEADNOD, 7, 1) ohbot.wait(0.5) ohbot.move(ohbot.HEADNOD, 1, 1) ohbot.wait(0.5) ohbot.move(ohbot.EYETURN, 9, 1) ohbot.wait(0.5) ohbot.move(ohbot.EYETURN, 1, 1) ohbot.wait(0.5) ohbot.move(ohbot.EYETURN, 5, 1) ohbot.wait(0.5) ohbot.say("Take one sweet.", True, False, False, 0) ohbot.wait(0.5) ohbot.say("At your own risk", True, False, False, 0) ohbot.wait(0.5) ohbot.say("Don't forget to brush your teeth", True, False, False, 0) ohbot.wait(0.5) ohbot.say("Happy Halloween", True, False, False, 0) ohbot.wait(0.5) ohbot.reset() # close ohbot at the end. ohbot.wait(0.5) ohbot.close() ohbot.wait(0.5) return True except: return False
from ohbot import ohbot import random # Run 'say -v?' in Terminal to list options for voices. speechSpeed is 90 +. ohbot.reset() ohbot.say("Hi it is great to be here, i am finally running on a mac, wow") ohbot.wait(2) ohbot.setVoice("Karen") ohbot.setSpeechSpeed(150) ohbot.move(ohbot.HEADTURN, random.randint(3, 6)) ohbot.say("hello i am Karen") ohbot.setVoice("Alex") ohbot.setSpeechSpeed(90) ohbot.move(ohbot.HEADTURN, random.randint(2, 6)) ohbot.say("hello i am Alex slow") ohbot.setVoice("Oliver") ohbot.move(ohbot.HEADTURN, random.randint(1, 6))
# +croak or +whisper # -a for amplitude (0 to 200) # -s for speed 80 to 500 # -p for pitech 0 to 99 from ohbot import ohbot import threading from time import time, sleep, localtime, strftime from random import randint # Switch the speech synthesizer to epseak ohbot.setSynthesizer("espeak") # Set the voice to english West Midlands accent medium speed. ohbot.setVoice("-ven-wm+m1 -s150") #module level variable for breaking out of the blinking thread blinking = False #this is called on a separate thread to blink the eyes while running def blinkLids(): while (blinking): ohbot.move(ohbot.LIDBLINK, 0) sleep(0.2) ohbot.move(ohbot.LIDBLINK, 10) #wait for a random amount of time for realistic blinking sleep(randint(0, 4))