copyright: years: 2018, 2023 lastupdated: "2023-01-05"
Deploying Voice Gateway with the Text to Speech Adapter on Docker
This documentation applies to a beta feature of IBM® Voice Gateway. For terms of use, see the beta license agreement.
For an on-premises installation, you can deploy the Text to Speech Adapter as part of your IBM® Voice Gateway environment on Docker. The Voice Gateway Text to Speech Adapter is packaged as a separate Docker image that you configure and deploy along with the core SIP Orchestrator and Media Relay images.
Before you begin
-
Familiarize yourself with Voice Gateway deployment options and deploy a basic environment as described in Getting started with Voice Gateway.
-
Find and make note of the credentials for your instances of the following Watson services:
You will not need a Text to Speech service instance.
-
Sign up for Google Cloud, and follow the Cloud Text-to-Speech API Quickstart documentation to complete the following steps:
- Create a Google Cloud project that enables Cloud Speech API.
- Create a service account for the project.
- Download the private key JSON file, which contains credentials for your service account.
Deploying the Text to Speech Adapter on Docker
The following instructions assume that you have already successfully deployed a basic Voice Gateway environment to Docker. For complete setup information for getting started with Docker deployments, see Deploying Voice Gateway on Docker.
-
Change to a directory from which you want to deploy Voice Gateway, and pull the latest images. You'll need the core Voice Gateway images, which are the SIP Orchestrator (
voice-gateway-so
) and Media Relay (voice-gateway-mr
), plus the Text to Speech Adapter image (voice-gateway-tts-adapter
).Tip: If you previously deployed Voice Gateway, you can use your existing images.
docker pull icr.io/voice-gateway/sip-orchestrator:latest docker pull icr.io/voice-gateway/media-relay:latest docker pull icr.io/voice-gateway/tts-adapter:latest
-
Clone the sample.voice.gateway GitHub repository and go to the
tts-adapter
directory, which contains the following sample files:docker-compose.ym
l: A Docker deployment file that is preconfigured with the minimum configuration to deploy Voice Gateway with the Text to Speech Adapter
Copy the
docker-compose.yml
file to your deployment directory. -
In the
docker-compose.yml
file, fill in any blank environment variables to configure Watson Assistant, the Speech to Text service, and the Google Cloud Text-to-Speech API.Tip: For previous deployments, just add the configuration for the
tts.adapter
container to your existingdocker-compose.yml
file.- Under the
sip.orchestrator
container, specify Watson Assistant credentials and workspace ID, as shown in the following example.
sip.orchestrator: ... environment: - WATSON_CONVERSATION_URL=https://api.us-south.assistant.watson.cloud.ibm.com/instances/{instance_id} - WATSON_CONVERSATION_USERNAME=9h7f54cb-d9ed-46b3-8492-e9a9bf555021 - WATSON_CONVERSATION_PASSWORD=InWtiUpYhF1Z - WATSON_CONVERSATION_WORKSPACE_ID=a23de67h-e527-40d5-a867-5c0ce9e72d0d ``` {:codeblock} * Under the `media.relay` container, configure credentials for the Speech to Text service. ```yaml media.relay: ... environment: - WATSON_STT_USERNAME=9h7f54cb-5epb-80d6-45c3-da41d2bf7a71 - WATSON_STT_PASSWORD=asxNzDLpIJ6F - WATSON_STT_URL=https://api.us-south.speech-to-text.watson.cloud.ibm.com/instances/{instance_id} ``` {:codeblock} * Under the `tts.adapter` container, mount the credentials JSON file that you downloaded from your Google Cloud project. Also specify the location within the container on the `GOOGLE_APPLICATION_CREDENTIALS` environment variable. If you want to specify a language other than English, specify the BCP-47 language tag on the `GOOGLE_TTS_VOICE_LANGUAGE_CODE` environment variable. For example, for Spanish (Spain), specify `es-ES`. Note that For a language to be supported, it must be supported by all services you integrate with Voice Gateway, including the third-party speech services and the Watson Assistant service. See [Supported languages](https://www.ibm.com/docs/en/voice-gateway?topic=gateway-about-voice#supported-languages) for details. For example: ```yaml tts.adapter: ... environment: - GOOGLE_APPLICATION_CREDENTIALS=/tts-adapter/credentials/google-service-account.json - GOOGLE_TTS_VOICE_LANGUAGE_CODE=es-ES volumes: - "/path/to/credentials/google-service-account.json:/tts-adapter/credentials/google-service-account.json"
- Under the
-
Start up the containers by running the following command:
docker-compose up
What to do next
You can further configure your Voice Gateway deployment by editing the docker-compose.yml
file and then redeploying the containers.