예제 #1
0
    def _detected_callback(self):
        def start_record():
            logger.info("开始录音")
            self._conversation.isRecording = True
            utils.setRecordable(True)

        if not utils.is_proper_time():
            logger.warning("勿扰模式开启中")
            return
        if self._conversation.isRecording:
            logger.warning("正在录音中,跳过")
            return
        self._conversation.interrupt()
        if config.get("/LED/enable", False):
            LED.wakeup()
        utils.setRecordable(False)
        Player.play(constants.getData("beep_hi.wav"),
                    onCompleted=start_record,
                    wait=True)
예제 #2
0
 def start_record():
     logger.info("开始录音")
     self._conversation.isRecording = True
     utils.setRecordable(True)