configuration_window.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:susi_linux 作者: fossasia 项目源码 文件源码
def init_hotword_switch(self):
        try:
            parent_dir = os.path.dirname(TOP_DIR)
            snowboyDetectFile = Path(os.path.join(
                parent_dir, "hotword_engine/snowboy/_snowboydetect.so"))
            print(snowboyDetectFile)
            if not snowboyDetectFile.exists():
                self.snowboy_switch.set_sensitive(False)
                config['hotword_engine'] = 'PocketSphinx'

        except Exception as e:
            logging.error(e)
            config['hotword_engine'] = 'PocketSphinx'

        if config['hotword_engine'] == 'Snowboy':
            self.snowboy_switch.set_active(True)
        else:
            self.snowboy_switch.set_active(False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号