@@ -1,7 +1,4 @@
# -*- coding: utf-8 -*-
-import sys
-reload(sys)
-sys.setdefaultencoding('utf8')
from demeter.core import *
from datetime import *
import time
@@ -4,7 +4,7 @@
"""
from __future__ import division
from ..__load__ import *
-from base import Base
+from .base import Base
class Ali(Base):
@@ -20,7 +20,7 @@ dev_pid:
# 需要百度SDK
from aip import AipSpeech
@@ -4,7 +4,7 @@ Emotibot机器人API:http://www.emotibot.com
class Emotibot(Base):
@@ -4,7 +4,7 @@ pyttsx3
class Espeak(Base):
class Tencent(Base):
class Tuling(Base):
@@ -6,7 +6,7 @@ voice_name: https://www.xfyun.cn/services/online_tts
import requests
import hashlib
@@ -41,7 +41,6 @@ class Brain(object):
"secret_key": 'KffXwW6E1alcGplcabcNs63Li6GvvnfL'
}
parsed = self.robot.doParse(text, **args)
- print parsed
return parsed
for plugin in self.plugins:
@@ -18,7 +18,6 @@ class Ear(object):
# 语音唤醒模式
def wait(self):
- print 22
return
self.robot.logger.debug(self.log('唤醒模式'))
if self.detector is not None:
@@ -13,7 +13,7 @@ class Mouth(object):
return self
def say(self, msg, cache=False, plugin='', completed=None):
- print msg
+ print(msg)
if self.onSay:
self.robot.logger.info(self.log('onSay: {}'.format(msg)))
if plugin != '':
@@ -1,7 +1,7 @@
import subprocess
class Sox(Base):
@@ -18,7 +18,7 @@ class Sox(Base):
self.logger.debug('Executing %s', ' '.join(cmd))
#self.proc = subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
- print cmd
+ print(cmd)
self.proc = subprocess.Popen(cmd)
self.playing = True
class Wav(Base):
@@ -3,7 +3,6 @@
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
-import _snowboydetect
from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
def swig_import_helper():
@@ -20,7 +20,7 @@ class Vecan(object):
self.robot = Demeter.service('robot')
self.robot.init()
- #self.robot.say('你好,我是神算终端机器人vecan,很高兴为你服务')
+ self.robot.say('你好,我是神算终端机器人vecan,很高兴为你服务')
Demeter.dog = WatchDog.init()