rabin 6 years ago
parent
commit
b58940152d

+ 1 - 1
service/api/baidu.py

@@ -20,7 +20,7 @@ dev_pid:
 """
 """
 from __future__ import division
 from __future__ import division
 from ..__load__ import *
 from ..__load__ import *
-from base import Base
+from .base import Base
 # 需要百度SDK
 # 需要百度SDK
 from aip import AipSpeech
 from aip import AipSpeech
 
 

+ 7 - 2
service/ear.py

@@ -18,8 +18,12 @@ class Ear(object):
 
 
 	# 语音唤醒模式
 	# 语音唤醒模式
 	def wait(self):
 	def wait(self):
+		self.robot.logger.info(self.log('唤醒模式'))
+		print(22)
+		import pyaudio
+		pa = pyaudio.PyAudio()
+		#print(pa.get_device_count())
 		return
 		return
-		self.robot.logger.debug(self.log('唤醒模式'))
 		if self.detector is not None:
 		if self.detector is not None:
 			self.detector.terminate()
 			self.detector.terminate()
 
 
@@ -39,7 +43,7 @@ class Ear(object):
 
 
 	# listen
 	# listen
 	def listen(self, silent=False):
 	def listen(self, silent=False):
-		self.robot.logger.debug(self.log('聆听模式'))
+		self.robot.logger.info(self.log('聆听模式'))
 		try:
 		try:
 			if not silent:
 			if not silent:
 				time.sleep(1)
 				time.sleep(1)
@@ -84,6 +88,7 @@ class Ear(object):
 
 
 	# callback
 	# callback
 	def detectedCallback(self):
 	def detectedCallback(self):
+		print(33)
 		if not self.isProperTime():
 		if not self.isProperTime():
 			self.robot.logger.warning(self.log('勿扰模式开启中'))
 			self.robot.logger.warning(self.log('勿扰模式开启中'))
 			return
 			return

+ 1 - 1
service/mouth.py

@@ -64,7 +64,7 @@ class Mouth(object):
 			self.speaker = None
 			self.speaker = None
 
 
 	def talk(self, fp, callback=None):
 	def talk(self, fp, callback=None):
-		self.play(self.robot.data + 'beep_lo.wav')
+		self.speek(self.robot.data + 'beep_lo.wav')
 		self.robot.logger.info(self.log('结束录音'))
 		self.robot.logger.info(self.log('结束录音'))
 		self.robot.isRecording = False
 		self.robot.isRecording = False
 		if self.robot.profiling:
 		if self.robot.profiling:

+ 3 - 4
service/player/sox.py

@@ -17,10 +17,9 @@ class Sox(Base):
 		cmd = ['play', '-v', str(self.volume), str(self.src)]
 		cmd = ['play', '-v', str(self.volume), str(self.src)]
 		self.logger.debug('Executing %s', ' '.join(cmd))
 		self.logger.debug('Executing %s', ' '.join(cmd))
 
 
-		#self.proc = subprocess.Popen(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
-		print(cmd)
-		return
-		self.proc = subprocess.Popen(cmd)
+		self.proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+		#print(cmd)
+		#return
 		self.playing = True
 		self.playing = True
 		self.proc.wait()
 		self.proc.wait()
 		self.playing = False
 		self.playing = False

BIN
service/snowboy/_snowboydetect.so


BIN
service/snowboy/ubuntu/14_snowboydetect.so


BIN
service/snowboy/ubuntu/16_snowboydetect.so


+ 1 - 1
vecan.py

@@ -20,7 +20,7 @@ class Vecan(object):
 
 
 		self.robot = Demeter.service('robot')
 		self.robot = Demeter.service('robot')
 		self.robot.init()
 		self.robot.init()
-		self.robot.say('你好,我是神算终端机器人vecan,很高兴为你服务')
+		#self.robot.say('你好,我是神算终端机器人vecan,很高兴为你服务')
 
 
 		Demeter.dog = WatchDog.init()
 		Demeter.dog = WatchDog.init()