c++ - GRPC 为 Google Assistant API 创建 channel 链接

标签 c++ google-assistant-sdk

我正在尝试编写 C++ 代码来在 UDOO x86 板上创建 Google Assistant(请参阅 https://developers.google.com/assistant/sdk/ )。 我已尝试遵循教程中的所有步骤,但我不确定调用 creatChannel 方法时应该使用什么 URL?

我确实下载了凭证 JSON,并通过“GOOGLE_APPLICATION_CREDENTIALS”环境变量使用它

对象创建:

GAssistantClient greeter(grpc::CreateChannel(
      "google.com", grpc::GoogleDefaultCredentials()));

构造函数:

GAssistantClient(std::shared_ptr<Channel> channel)
      : stub_(Greeter::NewStub(channel)) {}

当我将 google.com 放入其中时,出现以下错误: E0505 18:30:34.959710444 7635 ssl_transport_security.c:1226]无效的顶级子域:com E0505 18:30:34.959836517 7635 ssl_transport_security.c:1226] 无效的顶级子域:com

最佳答案

您必须使用您的凭据进行身份验证,然后创建一个 channel ,之后您发送有关您的音频的音频配置请求,然后发送包含您捕获的音频等的音频数据请求。

您可以使用 ALSA 声音 API 库来捕获和播放音频。 然后在 api 请求和响应中发送和接收。

您应该遵循following order in this doc

关于c++ - GRPC 为 Google Assistant API 创建 channel 链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43815904/

相关文章:

c++ - 执行循环停止后如何正确使用 QSharedPointer<QObject> 的析构函数?

c++ - 看不到 "control reaches end of non-void function [-Wreturn-type]"的原因

c++ - ActiveMQ CPP - 识别消息类型

dialogflow-es - 对话流 : controlling intent identification upon context conflict

python - 在树莓派上设置 Google Assistant SDK 时遇到问题

android - 启动 Google Assistant 语音交互

python - 用于Python的带有C++的简单SWIG可以编译,但是输出似乎不正确?

c++ - 麻将纸牌求解器算法,需要加速

dialogflow-es - 使用 Google Assistant Action 通过我的号码触发电话调用

javascript - 我想在 Action on Google 中添加列表