TTS

POST /services/tts

Convert text to speech and return an audio URL. This audio file will be available for 7 days after creation.

Request

Headers

Authorizationstring string required

OAuth token

Request body

textstring required

Text to be converted to audio. Cannot exceed 2000 characters for Polly and 425 characters for Bixby

languageCodestring required

Language used for the text to be converted to speech. Please refer tts/info API to get the options available

voiceIdstring required

VoiceId to be used for the text. Please refer tts/info API to get the options available

audioFormat'mp3' | 'pcm'

Audio format of the audio file, default to mp3 when ttsProvider is Amazon Polly, default to pcm when ttsProvider is Bixby. Amazon Polly supports mp3 and pcm. Bixby supports only pcm.

ttsProvider'polly' | 'bixby'

TTS provider to use for converting text to speech, default to polly

engine'standard' | 'neural'

TTS engine to be used, default to standard, standard - robotic voice, neural - human like and natural voice. This option is available only when ttsProvider is Amazon Polly. Please refer tts/info API to get the options available

speakingStyle'news' | 'conversational'

Speaking style to be used. This option is available only when ttsProvider is Amazon Polly, engine is neural, and voiceIds are one of the following - Matthew, Joanna, Lupe. Please refer tts/info API to get the options available

Example request

{
  "text": "Hi Samsung SmartThings! This is the text to speech service",
  "languageCode": "en-US",
  "voiceId": "Matthew",
  "audioFormat": "mp3",
  "ttsProvider": "polly",
  "engine": "neural",
  "speakingStyle": "conversational"
}

Response

Success

messagestring required

message to indicate success

audioURLstring required

Audio URL

Example response

{
  "message": "Successfully created an audio file",
  "audioURL": "https://generic-tts-prod.s3.amazonaws.com/polly/6f546dd37587382fdafd7eb8a68d15e833efc8ed7278b17bc8ceece20ce70876.mp3"
}

Changes

No recorded changes to this operation across all 8 revisions of this API.