PubNub Integration

IBM Watson: Text-to-Speech



Last Updated:




Get IBM Watson Text to Speech API Keys

Convert message text to audible speech in 7 different languages

Text to Speech from IBM Watson provides an API for converting message text to audible speech, for a wide variety of languages and voices, and customizable cadence, emotion, and tone.

The IBM Watson Text to Speech block converts text in your real-time data streams, and converts that input text to natural-sounding speech. For example, a chat app could process messages in one language, and output them verbally, in a different language.


This block adds a link to the original message in before publish event handler. The block performs calls to IBM Watson Text to Speech API with the auth credentials and query parameters required to convert the message text to an audio file.

To learn more about IBM Watson Text to Speech API and get your own API credentials, visit the IBM Watson Text to Speech API homepage.


Publish a message text on input channel. Input Channel: text-to-speech-chat

    "text": "Hi"


The url to a speech file is added to the JSON payload. Output Channel: text-to-speech-chat

    "text": "Hi", 
    "speech": <URL>

Feedback & Support

Need help? Contact PubNub Support.

Talk to an expert

Contact Sales