IBM Developer

Tutorial

Deploy the Watson Text to Speech runtime in Red Hat OpenShift and Kubernetes

Walk through the steps to deploy a text-to-speech service in Red Hat OpenShift using a Kubernetes cluster

By Himadri Talukder
Archived content

Archive date: 2025-06-12

This content is no longer being updated or maintained. The content is provided “as is.” Given the rapid evolution of technology, some content, steps, or illustrations may have changed.

The IBM Watson Text to Speech Service enables you to convert written text into natural-sounding audio in various languages and voices within an existing application or within IBM watsonx Assistant. This tutorial walks you through the steps to install a Text to Speech runtime service in Red Hat OpenShift. The tutorial uses this Helm Chart to deploy the service. You can use any classic Kubernetes cluster to deploy this text-to-speech Helm Chart.

Reference architecture

Reference architecture diagram

Prerequisites

To follow this tutorial, you must:

  • Install Helm 3.
  • Ensure that you have an entitlement key. You might need to create one. This key is required to access the images used in this tutorial.
  • Set an environment variable.

    export IBM_ENTITLEMENT_KEY=<Set the entitlement key>
    
  • Have a Red Hat OpenShift cluster on which you deploy the service.

Steps

Step 1. Install Text to Speech Helm Chart

Clone the Helm Chart GitHub repository.

git clone https://github.com/IBM/ibm-watson-embed-charts.git
cd ibm-watson-embed-charts/charts

The containers that are deployed by this chart come from the IBM Entitled Registry. You must create a Secret with credentials to pull from this registry. The default name is ibm-entitlement-key, but this can be changed by updating the value of imagePullSecrets.

The following code shows an example command to create the pull secret.

 oc create secret docker-registry ibm-entitlement-key \
  --docker-server=cp.icr.io \
  --docker-username=cp \
  --docker-password=$IBM_ENTITLEMENT_KEY \
  --docker-email=<your-email>

Note: By default, the models that are enabled are en-US_MichaelV3Voice and en-US_AllisonV3Voice with defaultModel set to en-US_AllisonV3Voice.

Helm Charts have configurable values that can be set at installation. To configure the values (for example, enabling additional models), refer to the base values.yaml file for documentation and value defaults. Values can be changed by using the --set parameter or by using YAML files that are specified with -f/--values. In the following example, I set values by using the --set parameter.

helm install tts-release ./ibm-watson-tts-embed-runtime \
--set license=true \
--set nameOverride=tts \
--set models.enUSTelephony.enabled=false

Step 2. Verify the chart

For chart verification, see the instructions (from the NOTES.txt file within the chart) after the Helm installation completes. The instructions also can be viewed by running the following command.

helm status tts-release

For basic usage of customization, see the customizing IBM Speech Library for Embed documentation.

You also can look at the complete API reference for the Watson Text to Speech Service.

Step 3. Use the service

  1. In one terminal, create a proxy through the service.

    oc proxy
    
  2. In another terminal, view the list of voices.

    
    curl --url "http://localhost:8001/api/v1/namespaces/stt-demo/services/https:tts-release-runtime:https/proxy/text-to-speech/api/v1/voices"
    
  3. Send a /synthesize request to generate speech and write the output.wav file.

    curl --url "http://localhost:8001/api/v1/namespaces/stt-demo/services/https:tts-release-runtime:https/proxy/text-to-speech/api/v1/recognize?model=en-US_AllisonV3Voice" \
          --header "Content-Type: application/json" \
          --data '{"text":"Hello world"}' \
          --header "Accept: audio/wav" \
          --output output.wav
    

Step 4. Uninstall the Chart

To uninstall and delete the Text to Speech deployment, run the following command.


helm delete tts-release

Summary

In this tutorial, you learned how to deploy Text to Speech runtime in Red Hat OpenShift. Try out the IBM Text to Speech Service. You can also try out more features in the IBM Natural Language Processing Library for Embed.