如何更改Google示例程序中Google Assistant的语言hotword.py'?

2024-10-01 19:31:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我说的是这个文件:https://github.com/googlesamples/assistant-sdk-python/blob/master/google-assistant-sdk/googlesamples/assistant/library/hotword.py 我将language参数添加到main()函数中,如下所示:

parser.add_argument(
    '--lang',
    metavar='<language code>',
    default='en-US',
    help='Language code of the Assistant')

有人知道我如何和在哪里解析这个论点来得到想要的语言(在我的例子中是德语)?在


Tags: 文件pyhttpsgithubmastercomgooglelibrary
1条回答
网友
1楼 · 发布于 2024-10-01 19:31:35

您应该查看this StackOverflow post以找到更改语言的正确方法。无法在hotword示例中设置语言。用户需要使用手机更改帐户的语言,这也会更新SDK设备上的语言(但hotword模型不会更改,所以您仍需要说“OK Google”)

相关问题 更多 >

    热门问题