DEV Community

César Freitas
César Freitas

Posted on

A cheap multilingual text-to-speech API (54 voices, 9 languages)

A cheap multilingual text-to-speech API can be a game-changer for developers and indie makers looking to add voice functionality to their projects without breaking the bank.

The problem is that most text-to-speech APIs are either extremely expensive or limited in terms of languages and voices. This can make it difficult for developers to find an API that meets their needs, especially when working on projects that require support for multiple languages.

Fortunately, there are some APIs that offer a more affordable solution with a wider range of languages and voices. One such API is the multilingual text-to-speech service we'll be discussing here.

This API solves the problem by providing a single endpoint that can convert text to natural speech in 9 different languages, using 54 different voices. This means that developers can use this API to create voice assistants, audiobooks, podcasts, and more, without having to worry about finding multiple APIs to support different languages.

In terms of how the API works, it's relatively simple. A developer submits a text request with the desired language and voice, and the API returns an MP3 or WAV audio file that contains the spoken text. The response is typically sent as a single file, making it easy for developers to integrate into their projects.

Here's what a typical request/response looks like:

A developer sends a JSON payload to the API with the following information:

  • text: the text they want to convert to speech
  • language: the language they want the speech to be in (e.g. "en", "fr", etc.)
  • voice: the voice they want to use (e.g. "male", "female", etc.)

The API processes this information and returns a file that contains the spoken text, either as an MP3 or WAV file.

One of the benefits of this API is its flexibility. Developers can easily switch between different languages and voices without having to worry about finding new APIs or modifying their code. This makes it a great option for projects that need to support multiple languages, such as chatbots, voice assistants, and more.

In short, the multilingual text-to-speech API offers a cost-effective solution for developers who need to create voice functionality in multiple languages. With 54 voices and 9 languages to choose from, this API has the potential to be a game-changer for indie makers and developers looking to add voice capabilities to their projects.

If you're interested in trying out this API and taking advantage of its free tier, we recommend checking it out on RapidAPI. RapidAPI offers a wide range of APIs, including this multilingual text-to-speech service, with a free tier that allows developers to try out new APIs without committing to a paid plan. So why not give it a shot? Create an account, sign up for the API, and start experimenting with this powerful tool today!

Quick example

curl -X POST 'https://multilingual-text-to-speech2.p.rapidapi.com/v1/tts' \
  -H 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY' \
  -H 'X-RapidAPI-Host: multilingual-text-to-speech2.p.rapidapi.com' \
  -H 'Content-Type: application/json' \
  -d '{"text":"Hello world","voice":"af_alloy","format":"mp3"}'
Enter fullscreen mode Exit fullscreen mode

Try it: the Multilingual Text-to-Speech API is live on RapidAPI with a free tier — get your key here.

Top comments (0)