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'
评论列表
文章目录