GRPC target method can't be resolved

58 views
Skip to first unread message

TUS

unread,
Jul 31, 2018, 9:03:57 AM7/31/18
to Google APIs Client Library for C++

#include <grpc++/grpc++.h>
#include <strings.h>

#include 
#include 
#include 
#include

#include "parse_arguments.h"
#include "google/cloud/texttospeech/v1/cloud_tts.grpc.pb.h"

using google:cloud:texttospeech::v1::TextToSpeech;
using google:cloud:texttospeech::v1::AudioConfig;
using google:cloud:texttospeech::v1::SynthesisInput;
using google:cloud:texttospeech::v1::SynthesizeSpeechRequest;
using google:cloud:texttospeech::v1::SynthesizeSpeechResponse;
using google:cloud:texttospeech::v1::ListVoicesRequest;
using google:cloud:texttospeech::v1::ListVoicesResponse;

int main(int argc, char** argv) {
auto creds = grpc::GoogleDefaultCredentials();
auto channel = grpc::CreateChannel("speech.googleapis.com", creds);
std::unique_ptrTextToSpeech::Stub tts(TextToSpeech::NewStub(channel));

ListVoicesRequest voice_request;
ListVoicesResponse voice_response;

grpc::ClientContext tts_context;
grpc::Status rpc_tts_status = tts->
ListVoices(&tts_context, voice_request, &voice_response);
if (!rpc_tts_status.ok()) {
std::cerr << rpc_tts_status.error_message() << rpc_tts_status.error_code() << rpc_tts_status.error_details() <<std::endl;
return -1;
}

return 0;
}

I'm trying to implement Google Text To Speech but I'm receiving this error: GRPC target method can't be resolved.

Any ideas?

Google APIs Client Library for C++

unread,
Jul 31, 2018, 9:08:10 AM7/31/18
to Google APIs Client Library for C++
This project does not work with gRPC.  You should try https://groups.google.com/forum/#!forum/grpc-io or https://stackoverflow.com/tags/grpc/
Reply all
Reply to author
Forward
0 new messages