gRPC setup
Before developing and running client applications, you need to set up the gRPC environment for your programming language.
Basic steps
The basic steps in using the gRPC protocol for Neural TTSaaS are:
-
Install gRPC for the programming language of your choice, including C++, Java, Python, Go, Ruby, C#, Node.js, and others. See the gRPC Documentation for a complete list and instructions on using gRPC with each one. For example, for Python:
python3 -m pip install --upgrade pip python3 -m pip install grpcio python3 -m pip install grpcio-tools
python -m pip install --upgrade pip python -m pip install grpcio python -m pip install grpcio-tools
-
Download proto file: nuance-synthesizer-proto.zip. This file contains a generic version of the functions or classes that perform speech synthesis.
-
Unzip the file in a location that your applications can access, for example in the directory that contains or will contain your client apps. On Linux, use the
unzip
command:unzip nuance-synthesizer-proto.zip ├── Your client apps here └── nuance └── tts └── v1 └── synthesizer.proto
-
If your programming language requires client stub files, generate the stubs from the proto file using gRPC protoc, following the Python example as guidance. Run these commands from the directory just above the nuance directory.
These stubs contain the methods and fields from the proto files as implemented in your programming language. Some languages, such as Node.js, can use the proto files directly, meaning client stubs are not required. Consult the gRPC documentation for your programming language.
# Generate Python stubs for synthesis python3 -m grpc_tools.protoc --proto_path=./ --python_out=./ --grpc_python_out=./ nuance/tts/v1/synthesizer.proto
rem Generate Python stubs for synthesis python -m grpc_tools.protoc --proto_path=./ --python_out=./ --grpc_python_out=./ nuance/tts/v1/synthesizer.proto
Final structure
The resulting files contain the information in the proto files in your programming language.
├── Your client apps here
└── nuance
└── tts
└── v1
├── synthesizer_pb2.py
├── synthesizer_pb2_grpc.py
└── synthesizer.proto
What’s next?
Once you have the proto file and optionally the client stubs, you are ready to develop and run client applications with the help of a Sample synthesis client for Neural TTSaaS.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.