from rstem.accel import Accel
from rstem.sound import Speech
import random
import time

ready_tts = Speech("Ready to play?")

tilt_left_tts = Speech("Tilt left!")
tilt_right_tts = Speech("Tilt right!")
tilt_up_tts = Speech("Tilt up!")
shake_me_tts = Speech("Shake me!")
no_action_tts = Speech("No action!")

detect_tts = Speech("I detected:")
wrong_tts = Speech("Oops!")
correct_tts = Speech("Correct!")
try_again_tts = Speech("Try again another time!")

actions_tts = [no_action_tts, tilt_left_tts, tilt_right_tts, tilt_up_tts, shake_me_tts]

for speech in [ready_tts, tilt_left_tts, tilt_right_tts, tilt_up_tts,
                shake_me_tts, no_action_tts, detect_tts, wrong_tts, 
                right_tts, try_again_tts]:
    speech.volume = 400

accel = Accel()

NOACTION = 0
LEFT = 1
RIGHT = 2
UP = 3
示例#2
0
from rstem.accel import Accel
from rstem.sound import Speech
import random
import time

ready_tts = Speech("Ready to play?")

tilt_left_tts = Speech("Tilt left!")
tilt_right_tts = Speech("Tilt right!")
tilt_up_tts = Speech("Tilt up!")
shake_me_tts = Speech("Shake me!")
no_action_tts = Speech("No action!")

detect_tts = Speech("I detected:")
wrong_tts = Speech("Oops!")
correct_tts = Speech("Correct!")
try_again_tts = Speech("Try again another time!")

actions_tts = [
    no_action_tts, tilt_left_tts, tilt_right_tts, tilt_up_tts, shake_me_tts
]

accel = Accel()

NOACTION = 0
LEFT = 1
RIGHT = 2
UP = 3
SHAKE = 4

# Ready to play?
def speech_play():
    s = Speech("Test")
    s.play()
    s.wait()
    return True
def speech_manual_play():
    '''The text "These aren't the droids you're looking for." will play on the speaker.'''
    s = Speech("These aren't the droids you're looking for.")
    s.play()
    s.wait()
示例#5
0
def speech_manual_play():
    '''The text "These aren't the droids you're looking for." will play on the speaker.'''
    s = Speech("These aren't the droids you're looking for.")
    s.play()
    s.wait()
示例#6
0
def speech_play():
    s = Speech("Test")
    s.play()
    s.wait()
    return True
示例#7
0
def speech_wait_chainable():
    Speech("test").wait().wait()
    return True
示例#8
0
def speech_stop_chainable():
    Speech("test").stop().stop()
    return True
示例#9
0
def speech_play_chainable():
    Speech("test").play().play()
    return True