-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathqidong.py
43 lines (34 loc) · 885 Bytes
/
qidong.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 26 21:13:41 2017
@author: Alwayswdc
@project: Turing Robot and Baiduyiyin Demo
需要下载百度语音合成的第三方库,也就是这个aip库,详见百度语音官网
"""
import urllib,json
from aip import AipSpeech
import os
import time
import win32api
import win32gui
from multiprocessing import Process
def enter():
time.sleep(2)
appname = "语音机器人"
enter = 0x0D
window = win32gui.FindWindow(None, appname)
try:
win32gui.SetForegroundWindow(window)
except:
pass
win32api.keybd_event(enter,0,0,0)
time.sleep(0.1)
win32api.keybd_event(enter,0,0,0)
time.sleep(0.1)
win32api.keybd_event(enter,0,0,0)
time.sleep(0.1)
win32api.keybd_event(enter,0,0,0)
time.sleep(0.1)
win32api.keybd_event(enter,0,0,0)
time.sleep(0.1)
enter()