June 18, 2013 7:02 am

How to convert text to MP3 speech/Voice using Google API

Today I am going to give you a great article on text to voice conversion.  To convert text to voice I have used Google TTS (Text to Speech) it will create an mp3 file and play it its a very simple script you must try its written in PHP it can convert almost 50+ languages. This Class converts text to speech using Google text to speech API to transform text to mp3 file which will be downloaded and later used as eg. embed file.



Calling Google url to get mp3 file.

If you have any problem in using this code please write in comments and need your feedback.

Author Huzoor Bux

I am Huzoor Bux from Karachi (Pakistan). I have been working as a PHP Developer from last 5+ years, and its my passion to learn new things and implement them as a practice. Basically I am a PHP developer but now days exploring more in HTML5, CSS and jQuery libraries.

Tutorial Categories:
  • Kirubanandan.K

    How to convert mp3 to text?

  • kami

    this is great but would you like to tell me is this free for life time to use google api??

  • Michael Cerasoli

    hi its michael cerasoli i’ve been a programmer since 1990 using windows and client server applications before 1990 using basic, and the Texas Instruments TRS-80. All these concepts have been around since then from 1995 to present things just started going down. But that’s ok, Microsoft’s 90 billion dollar industry certainly made up for it. And OFFICE is an incredibile product isn’t it? Man when windows came out I read every book the operating system came with about 15 manuals I read every one of them and never had to learn a thing since (with my mainframe, unix, db2, and c programming background of course). Anyway this is great and I thank you for all your wonderful time and support. 🙂

  • Michael Cerasoli

    It’s always good to give out the completed code but hey let the programmer figure it out I don’t think anyone wants some “hack” to come in and steal the show am I right?

    I just like to see the completed product you know syntax was always my problem in college anyway are you able to display the finished product, with html tags and all?