简体   繁体   中英

How do I change the language of Google Assistant in Google's sample program 'hotword.py'?

I'm talking about this file here: https://github.com/googlesamples/assistant-sdk-python/blob/master/google-assistant-sdk/googlesamples/assistant/library/hotword.py I added the language argument to the main() function like this:

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

Does anyone know how and where can I parse this argument to get the wanted language (in my case German)?

You should look at this StackOverflow post for the right way to change languages. The language cannot be set in the hotword sample. Users will need to use their phone to change the language for their account, which will also update the language on SDK devices (but the hotword model will not change, so you'll still need to say "OK Google")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM