简体   繁体   English

在Google智能助理响应中使用多种语言

[英]Use multiple languages in a Google Assistant response

In the Translation prebuilt app it seems it can response in different language based on user input, but I could not figure out how to specify it in my fulfillment hook. 在翻译预建应用程序中,它似乎可以根据用户输入以不同的语言进行响应,但我无法弄清楚如何在我的履行挂钩中指定它。

SSML has a <lang> tag but it does not seems to be supported by Actions on Google, I suppose I can use <audio> and another API to get audio for the other language? SSML有一个<lang>标签但似乎不受Google上的Actions支持,我想我可以使用<audio>和另一个API来获取另一种语言的音频?

If that is not possible can we specify language for a response? 如果不可能,我们可以为响应指定语言吗?

You can not specify a specific language for a response since the language is bound to the user's locale. 您无法为响应指定特定语言,因为该语言已绑定到用户的语言环境。 Using an <audio> tag would be a valid option to return the desired response in your language of choice. 使用<audio>标签将是一个有效的选项,可以用您选择的语言返回所需的响应。 However you'd need to have all the audio files available on an HTTPS server or generate them at runtime, and the Assistant seems to have some issues with the latter. 但是,您需要在HTTPS服务器上提供所有可用的音频文件,或者在运行时生成它们,并且助理似乎在后者中存在一些问题。

Similar thread: Bilingual spoken flash cards for Google Assistant 类似主题: Google智能助理的双语口语闪存卡

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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