RapidAPI logo

Text to Speech - TTS

FREEMIUM
By VIOMATIC.com
Updated 4 months ago
Media
1.9/10
Popularity Score
1722ms
Latency
100%
Success Rate

Text to Speech - TTS API Documentation

Turns text into an mp3 file. Simple+Fast. Male+Female Voice. Many Languages. Try it!

View API Details
POST/getmp3
POST/getmp3

converts text into MP3 audio file and returns the link and duration of the audio file in seconds

Header Parameters
X-RapidAPI-HostSTRING
REQUIRED
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
textSTRING
REQUIREDtext that should be spoken
languageSTRING
REQUIREDlanguage of the text (en, fr, de, it, ru, es, pt, pl)
Optional Parameters
sexSTRING
OPTIONALsex of the voice. "male" or "female"
Code Snippet
unirest.post("https://viomatic-com-text-to-speech-tts-v1.p.rapidapi.com/getmp3?sex=female&text=hello&language=en")
.header("X-RapidAPI-Host", "viomatic-com-text-to-speech-tts-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response
General
Request URL: https://viomatic-com-text-to-speech-tts-v1.p.rapidapi.com/getmp3
Request Method: POST
Response Headers
Response Body
Log inSign up

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://viomatic-com-text-to-speech-tts-v1.p.rapidapi.com/getmp3?sex=female&text=hello&language=en")
.header("X-RapidAPI-Host", "viomatic-com-text-to-speech-tts-v1.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication