예제 #1
0
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({
    "media": media,
    "speech": speech,
    "nlp": nlp,
    "mqtt": mqtt,
    "serial": serial,
    "thread": thread,
예제 #2
0
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")