config_generator.py 文件源码

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

项目:susi_linux 作者: fossasia 项目源码 文件源码
def request_hotword_choice():
    """ Method to request user for default Hotword Engine and configure it in settings.
    """
    try:
        print("Checking for Snowboy Availability...")
        snowboyDetectFile = Path("main/hotword_engine/snowboy/_snowboydetect.so")
        if snowboyDetectFile.exists():
            print("Snowboy is available on this platform")
            choice = input("Do you wish to use Snowboy as default Hotword Detection Engine (Recommended). (y/n) ")
            if choice == 'y':
                config['hotword_engine'] = 'Snowboy'
                print('\nSnowboy set as default Hotword Detection Engine\n')
            else:
                config['hotword_engine'] = 'PocketSphinx'
                print('\nPocketSphinx set as default Hotword Detection Engine\n')

    except Exception:
        print("Some Error Occurred. Using PocketSphinx as default engine for Hotword. Run this script again to change")
        config['hotword_engine'] = 'PocketSphinx'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号