#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::texttospeech::v1::TextToSpeech;
using google::texttospeech::v1::AudioConfig;
using google::texttospeech::v1::SynthesisInput;
using google::texttospeech::v1::SynthesizeSpeechRequest;
using google::texttospeech::v1::SynthesizeSpeechResponse;
using google::texttospeech::v1::ListVoicesRequest;
using google::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?