How to connect google cloud speech using gRPC C++

98 views
Skip to first unread message

Manh Tran

unread,
Aug 25, 2016, 6:57:21 AM8/25/16
to grpc.io
Hi,

I've used the code following to connect google cloud speech, but I haven't receive a response. Please show me how to connect to google cloud speech using gRPC C++.
..
using google::cloud::speech::v1beta1::Speech;

class GoogleClient {
 public:
GoogleClient(std::shared_ptr<Channel> channel)
      : stub_(Speech::NewStub(channel)) {}
 private:
  std::unique_ptr<Speech::Stub> stub_;
};

int main(int argc, char** argv) {

auto channel_creds = grpc::GoogleDefaultCredentials();
auto channel = grpc::CreateChannel("speech.googleapis.com:443", channel_creds);
GoogleClient ggclient(channel);
..
}

Thanks.
Reply all
Reply to author
Forward
0 new messages