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