Convert text to MP3 speech using Google API

In this post, I am going to write about text to voice conversion. For this, I will Google’s TTS (Text to speech) API. It will translate your text to an mp3 file. And you can simply plat this mp3 file. It is worth to note that Google’s text to speech API supports more than 50 languages. So, you can try this in your local languages.

Text 2 speech

Use of the API is very simple. You just need to call the API via the simple get request.

And this will send a MP3 file in responce

Get the MP3 content and save it in a file.

Now use audio tag to embed and play this audio file in the browser.

I created a demo page where you can see this API working live.

Demo

advertisement

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest updates, web design resources and tools.

You have Successfully Subscribed!

About The Author

  • ADD YOUR COMMENT

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Receive fresh web design resources and SEO tips in your email by our weekly newsletter

You have Successfully Subscribed!