Conference Campaign Solo Rich Messaging

Voice Gateway

Text-to-Speech

TTS: Convert text to lifelike speech.


TTS Demo

Voice Gateway : Text-to-Speech

People like talking with people, and listening to people. With Text-to-Speech you can synthesise human speech and make interaction with an automated system more natural. Natural interactions deliver positive customer experiences that drive adoption of services.

The Text-to-Speech service allows an application to have a text-to-speech (TTS) conversion performed on a long or short text. The resulting lifelike voice stream (MP3 format) can then be delivered via a number of different channels:

  • Returned during RESTful Voice API call (synchronous)
  • HTTPS retrieval using RESTful Voice API call (asynchronous)
  • Attachment in an email or HTTPS callback (POST)
  • URL link in an email, SMS or HTTPS callback
  • Playback during a SIP call
  • Voice messaging - delivery via voice call

Don't see what you need - then ask for it!

Don't see something you need, then make a feature request.

Zapier

Find us on Zapier. Use our invite link to access Melrose Labs Speech.

Zapier: Melrose Labs Speech

Text-to-Speech is a cloud service that quickly converts text into high quality lifelike speech. You can use Text-to-Speech to develop applications that increase engagement and accessibility. Text-to-Speech supports multiple languages and includes a variety of lifelike voices, so you can build speech-enabled applications that work worldwide and use the ideal voice for your customers, whatever their language.

Standard and Neural TTS

The standard speech engine produces high quality speech for all supported voices. For en-GB, en-US and some es-US and pt-BR voices, the neural speech engine can be used to produce perfectly natural speech. Where a voice is supported by the neural speech engine, the service will use the neural speech engine by default.

See available TTS language and voices for samples, and for which use the neural speech engine.

SSML

Speech Synthesis Markup Language (SSML) is supported by the Text-to-Speech service. When using SSML, the text you wish to be converted should start with ssml: and be contained in <speak></speak> tags.

For example: ssml:<speak>Mary had a little lamb <break time="3s"/>Whose fleece was white as snow.</speak>

TTS Demonstration


Using the Service

The Melrose Labs Text-to-Speech service is available using the SMTP API (email), Text-to-Speech REST API and Zapier (Melrose Labs Speech).

Voices and languages for TTS are listed below.

The following languages and voices are available using the Text-to-Speech service of the Voice API:

Language Voice Sample Email (example)
Arabic (arb)Zeina (f) zeina.arb.voice@api.melroselabs.com
Chinese, Mandarin (cmn-CN)Zhiyu (f) zhiyu.cmn-cn.voice@api.melroselabs.com
Danish (da-dk)Mads (m)
Naja (f)
mads.da-dk.voice@api.melroselabs.com
Dutch (nl-nl)Lotte (f)
Ruben (m)
lotte.nl-nl.voice@api.melroselabs.com
English, Australian (en-AU)Russell (m)
Nicole (f)
russell.en-au.voice@api.melroselabs.com
English (en-GB)²Emma (f)
Amy (f)
Brian (m)
emma.en-gb.voice@api.melroselabs.com
English, Indian (en-IN)Aditi (f)
Raveena (f)
aditi.en-in.voice@api.melroselabs.com
English (en-US)²Salli (f)¹
Ivy (f)
Joanna (f)
Kendra (f)
Kimberly (f)
Joey (m)
Justin (m)
Matthew (m)
salli.en-us.voice@api.melroselabs.com
English, Welsh (en-GB-WLS)Geraint (m) geraint.en-gb-wls.voice@api.melroselabs.com
French (fr-FR)Céline/Celine (f)
Léa/Lea (f)
Mathieu (m)
celine.fr-fr.voice@api.melroselabs.com
French, Canadian (fr-CA)Chantal (f) chantal.fr-ca.voice@api.melroselabs.com
Germany (de-DE)Vicki (f)
Marlene (f)
Hans (m)
vicki.de-de.voice@api.melroselabs.com
Hindi (hi-IN)Aditi (f) aditi.hi-in.voice@api.melroselabs.com
Icelandic (is-IS)Karl (m)
Dóra/Dora (f)
karl.is-is.voice@api.melroselabs.com
Italian (it-IT)Bianca (f)
Carla (f)
Giorgio (m)
bianca.it-it.voice@api.melroselabs.com
Japanese (ja-JP)Mizuki (f)
Takumi (m)
mizuki.ja-jp.voice@api.melroselabs.com
Korean (ko-KR)Seoyeon (f) seoyeon.ko-kr.voice@api.melroselabs.com
Norwegian (nb-NO)Liv (f) liv.nb-no.voice@api.melroselabs.com
Polish (pl-PL)Jan (m)
Ewa (f)
Maja (f)
Jacek (m)
jan.pl-pl.voice@api.melroselabs.com
Portuguese (pt-BR)Camila² (f)
Vitória/Vitoria (f)
Ricardo (m)
vitoria.pt-br.voice@api.melroselabs.com
Portuguese (pt-PT)Cristiano (m)
Inês/Ines (f)
cristiano.pt-pt.voice@api.melroselabs.com
Romanian (ro-RO)Carmen (f) carmen.ro-ro.voice@api.melroselabs.com
Russian (ru-RU)Tatyana (f)
Maxim (m)
tatyana.ru-ru.voice@api.melroselabs.com
Spanish (es-ES)Enrique (m)
Lucia (f)
Conchita (f)
enrique.es-es.voice@api.melroselabs.com
Spanish (es-MX)Mia (f) mia.es-mx.voice@api.melroselabs.com
Spanish (es-US)Lupe² (f)
Penélope/Penelope (f)
Miguel (m)
penelope.es-us.voice@api.melroselabs.com
Swedish (sv-SE)Astrid (f) astrid.sv-se.voice@api.melroselabs.com
Turkish (tr-TR)Filiz (f) filiz.tr-tr.voice@api.melroselabs.com
Welsh (cy-GB)Gwyneth (f) gwyneth.cy-gb.voice@api.melroselabs.com

¹ Default voice. Used for voice@api.melroselabs.com or when no voice is specified during a Voice API REST call.
² Will use neural engine unless standard engine is requested.

Email - SMTP API

The Melrose Labs Text-to-Speech service is available using our SMTP API (email).

Using Email to Access the Text-to-Speech Service

Email can be used to easily and quickly perform a text-to-speech (TTS) conversion as an alternative to using REST HTTPS calls to the Voice API. Send an email to the Text-to-Speech service at voice@api.melroselabs.com and use the subject field to contain the text you wish converted. After a number of seconds, you will receive an email back from the service with an MP3 file containing the converted speech.

Various voices and corresponding languages are available using email addresses specific to each voice. The format of each email address is voice.language.voice@api.melroselabs.com and the options for voice and language are shown in the list of available languages and voices.

An API key is currently not required when using email.

REST API

The Melrose Labs Text-to-Speech service is available using our REST API.

Convert text to speech using the Voice Gateway Text-to-Speech service with RESTful Voice API
Example using cURL, Node.js, Python and PHP

Submit conversion request and retrieve resulting speech.

Request:

curl --location --request POST https://api.melroselabs.com/voice/tts/ \
	--header 'x-api-key: [API_KEY]' --header 'Content-Type: application/json' \
	--data-raw '{"voiceText": "Welcome Allan. The event for today will begin at 9.30am in room H32.", "voice": "Emma"}'

Response:

MP3 file

Request:

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.melroselabs.com/voice/tts/',
  'headers': {
    'x-api-key': '[API_KEY]',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({"voiceText": "Welcome Allan. The event for today will begin at 9.30am in room H32.", "voice": "Emma"})
};
request(options, function (error, response) { 
  if (error) throw new Error(error);
  console.log(response.body); // response is of type audio/mp3
});

Response:

MP3 file

Request:

import requests
import json

url = "https://api.melroselabs.com/voice/tts/"
payload = {
	{"voiceText": "Welcome Allan. The event for today will begin at 9.30am in room H32.", "voice": "Emma"}
}
headers = {
  'x-api-key': '[API_KEY]',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data = json.dumps(payload))

# response is of type audio/mp3
print(response.content)

Response:

MP3 file

Request:

<?php 
$data = {"voiceText": "Welcome Allan. The event for today will begin at 9.30am in room H32.", "voice": "Emma"}

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.melroselabs.com/voice/tts/",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $data,
  CURLOPT_HTTPHEADER => array(
    "x-api-key: [API_KEY]",
    "Content-Type: application/json"
  )
));

$response = curl_exec($curl);

curl_close($curl);

echo $response; // response is of type audio/mp3
?>

Response:

MP3 file

The asyncronous method is a two step process involving the submiting of the conversion request and then the retrieval of the result.

1. Submit conversion request.

Request:

curl --location --request POST https://api.melroselabs.com/voice/texttospeech/ \
	--header 'x-api-key: [API_KEY]' --header 'Content-Type: application/json' \
	--data-raw '{"voiceText": "Welcome Allan. The event for today will begin at 9.30am in room H32.", "voice": "Emma"}'

Response:

{"transactionID": "1ccead78-6550-4aac-a6b4-a4942b908659"}

Request:

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.melroselabs.com/voice/texttospeech/',
  'headers': {
    'x-api-key': '[API_KEY]',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({"voiceText": "Welcome Allan. The event for today will begin at 9.30am in room H32.", "voice": "Emma"})
};
request(options, function (error, response) { 
  if (error) throw new Error(error);
  console.log(response.body); // response is of type application/json
});

Response:

{"transactionID": "1ccead78-6550-4aac-a6b4-a4942b908659"}

Request:

import requests
import json

url = "https://api.melroselabs.com/voice/texttospeech/"
payload = {
	{"voiceText": "Welcome Allan. The event for today will begin at 9.30am in room H32.", "voice": "Emma"}
}
headers = {
  'x-api-key': '[API_KEY]',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data = json.dumps(payload))

# response is of type application/json
print(response.text.encode('utf8'))

Response:

{"transactionID": "1ccead78-6550-4aac-a6b4-a4942b908659"}

Request:

<?php 
$data = {"voiceText": "Welcome Allan. The event for today will begin at 9.30am in room H32.", "voice": "Emma"}

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.melroselabs.com/voice/texttospeech/",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $data,
  CURLOPT_HTTPHEADER => array(
    "x-api-key: [API_KEY]",
    "Content-Type: application/json"
  )
));

$response = curl_exec($curl);

curl_close($curl);

echo $response; // response is of type application/json
?>

Response:

{"transactionID": "1ccead78-6550-4aac-a6b4-a4942b908659"}

2. Retrieve resulting speech.

Request:

curl --location --request GET https://api.melroselabs.com/voice/texttospeech/1ccead78-6550-4aac-a6b4-a4942b908659 \
	--header 'x-api-key: [API_KEY]' 

Response:

MP3 file

Request:

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://api.melroselabs.com/voice/texttospeech/1ccead78-6550-4aac-a6b4-a4942b908659',
  'headers': {
    'x-api-key': '[API_KEY]'
  }
};
request(options, function (error, response) { 
  if (error) throw new Error(error);
  console.log(response.body); // response is of type audio/mp3
});

Response:

MP3 file

Request:

import requests
import json

url = "https://api.melroselabs.com/voice/texttospeech/1ccead78-6550-4aac-a6b4-a4942b908659"

headers = {
  'x-api-key': '[API_KEY]'
}

response = requests.request("GET", url, headers=headers)

# response is of type audio/mp3
print(response.content)

Response:

MP3 file

Request:

<?php 
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.melroselabs.com/voice/texttospeech/1ccead78-6550-4aac-a6b4-a4942b908659",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "x-api-key: [API_KEY]"  )
));

$response = curl_exec($curl);

curl_close($curl);

echo $response; // response is of type audio/mp3
?>

Response:

MP3 file

Zapier

Find us on Zapier. Use our invite link to access Melrose Labs Speech.

Zapier: Melrose Labs Speech

TTS Conversion Speed

Conversion of text-to-speech takes place extremely fast, regardless of whether you are using the service via email, REST API or Zapier.

Text-to-Speech Conversion Timings

The following timings were performed using synchronous API calls with cURL and an extract from Alice in Wonderland by Lewis Carol.

Number of words:15 words57 words112 words253 words
Total TTS Duration (seconds):0.5360.7150.9401.420

Pricing

The Text-to-Speech service is provided free-of-charge.


The Text-to-Speech service is one of the many building blocks we are releasing over the coming months as part of the Voice Gateway, and making available through the Voice API.

Need to convert speech-to-text? See our Speech-to-Text service.

Don't see what you need - then ask for it!

Don't see something you need, then make a feature request.

Follow us on LinkedIn for updates on Melrose Labs Text-to-Speech and our other services.

Service snapshot

  • Lifelike voices
  • Asyncronous and syncronous RESTful API
  • Large selection of voices
  • Multi-language support
  • Fast TTS conversion

Find out more...

Please provide your name.
Please provide a valid company name.
Please type your message.
Please provide a valid email address.