简体   繁体   English

如何以编程方式触发谷歌家庭广播

[英]How to programmatically trigger google home broadcast

What I'd like to do is write some code like:我想做的是编写一些代码,例如:

var googleHome = new GoogleHomeSdk();
var devices = ['kitchen', 'lounge', 'bedroom'];

googleHome.broadcast({
   devices : devices,
   message : 'The front door has been open for 30 seconds'
});

Which would then do something similar to the native broadcast feature, ie where you type 'broadcast ' into the google assistant app on phones/tablets.然后它将执行类似于本机广播功能的操作,即您在手机/平板电脑上的谷歌助手应用程序中键入“广播”。

I can't seem to find any google documentation for an API like this but it seems like such a basic/obvious requirement that surely something like this must exist?我似乎找不到像这样的 API 的任何谷歌文档,但它似乎是一个基本/显而易见的要求,肯定必须存在这样的东西?

Note: I've seen a workaround where people have casted an audio file (obtained via text-to-speech service) but this isn't really what I'm after.注意:我见过一种解决方法,人们已经投射了一个音频文件(通过文本到语音服务获得),但这并不是我真正想要的。

The platform does not provide a mechanism to programmaticlly broadcast messages to different devices.该平台不提供以编程方式将消息广播到不同设备的机制。

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

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