from moocxing.package import MOOCXING from moocxing.robot.Brain import Brain mx = MOOCXING() #自己注册百度API APP_ID = '23084370' API_KEY = 'KpNbsHjl3BPsKGXgc6r9bbzt' SECRET_KEY = 'RyqDNA3ACZB857kLxM7VHCGZxGk4HylB' #初始化播放器和录音模块 media = mx.initMedia() #初始化串口模块 serial = mx.initSerial(com="COM31", bps=9600) #初始化语音识别+语音合成模块 speech = mx.initSpeech(APP_ID, API_KEY, SECRET_KEY) print("******************初始化完成******************\n") #初始化技能插件 brain = Brain({ "media": media, " speech": speech, "serial": serial, }) print("***************技能插件加载完成***************\n") #语音合成十播放 def TTSPlay(text): speech.TTS(text) media.play()
from moocxing.package import MOOCXING from moocxing.robot.Brain import Brain mx = MOOCXING() # 自己注册百度API APP_ID = '23084383' API_KEY = 'OVroLCSOKhNl2XOZ155PlknW' SECRET_KEY = 'Af4yMbptkkXdz7gw7LzUL5Sa49y3Mc8m' # 初始化播放器和录音模块 media = mx.initMedia() # 初始化多线程模块 thread = mx.initThread() # 初始化MQTT模块 mqtt = mx.initMqtt() # 初始化拼音模块 pinyin = mx.initPinyin() # 初始化我的世界 mc = mx.initMinecraft() # 初始化串口模块 serial = mx.initSerial(com="COM3", bps=9600) # 初始化语音识别+语音合成模块 speech = mx.initSpeech(APP_ID, API_KEY, SECRET_KEY) # 初始化NLP模块 nlp = mx.initNLP(APP_ID, API_KEY, SECRET_KEY) print("******************初始化完成******************\n") # 初始化技能插件 brain = Brain({
from moocxing.package import MOOCXING from moocxing.robot.Brain import Brain import time import serial mx = MOOCXING() #百度API APP_ID = '22929503' API_KEY = 'WresMkF1o4342KeqZBOsjXId' SECRET_KEY = 'BrDOj5quiTuhwxpULsVzWdw5nmcyrTIl' #初始化播放器和录音模块 media = mx.initMedia() #初始化串口模块 serial = mx.initSerial(com='COM3', bps=9600) #初始化我的世界 mc = mx.initMinecraft() #初始化语音识别+语音合成模块 speech = mx.initSpeech(APP_ID, API_KEY, SECRET_KEY) print("*************初始化完成*************\n") #初始化技能插件 brain = Brain({ "media": media, "speech": speech, "serial": serial, "minecraft": mc, }) print("*************初始化完成*************\n")