Page 308 - 3-2
P. 308
b3 = pygame.image.load('b3.png')
b4 = pygame.image.load('b4.png')
b5 = pygame.image.load('b5.png')
b6 = pygame.image.load('b6.png')
def first():
global x,y
mainscreen = pygame.image.load('mainscreen.png')
screen.blit(mainscreen, (0, 0))
pygame.display.flip()
sensor_start() # sensor.py
serial_info(81) # 초기값 reset
# 메인 루프
while True:
for event in pygame.event.get():
# 창닫기 버튼을 눌렀을 때
if event.type == QUIT:
pygame.quit()
sys.exit()
# 마우스 이벤트 처리
if event.type == MOUSEBUTTONDOWN and event.button == LEFT:
x,y = pygame.mouse.get_pos()
exit()
if(630 < x < 1005) and (15 < y < 50): # 창 닫기
pygame.quit()
sys.exit()
elif(530 < x < 700) and (460 < y < 550): speak() # 음성인식
elif(350 < x < 500) and (460 < y < 550): initial(1) # 수동
def speak(): # 음성인식
screen.blit(speak_ready, (0, 0))
exit()
serial_info(80)
pygame.display.flip()
pygame.mixer.init()
pygame.mixer.music.load("1.mp3") # " 도착역을 말해주세요."
pygame.mixer.music.play()
time.sleep(3)
info = main_voice() # transcribe_streaminig.py
print("info: ",info)
train(info)
def search(x,y): # 수동 모드
while True:
- 308 -