Skip to content

A text reader that uses Google Cloud Text-to-speech Wavenet voices to synthesize

License

Notifications You must be signed in to change notification settings

godspirit00/TextReaderUsingGcloudTTS

Repository files navigation

Text Reader Using Google Cloud Text-to-speech

A text reader that uses Google Cloud Text-to-speech Wavenet voices to synthesize speeches.

This project is designed to make English listening audio for English learners in China, but it can also serve other purposes. Google uses groundbreaking research in speech synthesis (WaveNet) and Google's powerful neural networks to deliver high-fidelity audio, which is much better than what is commonly used to make English listening audio for English learners in China at present.

Features

  • Uses Google Cloud Text-to-speech Wavenet voices to synthesize
  • Partial SSML support, including the <voice> tag that is not supported by Google. This project will handle this tag for you.
  • Friendly SSML editor. The decent-looking and mobile-friendly (thanks to Bootstrap) editor relieves you of typing the tags manually.
  • Dialog Maker to help you transform speaker indicators like "Tony:", "Betty:", etc. to the <voice> tags so that these lines will be read by desired voices.
  • Automatically detects lines written in Chinese and have them read by a Chinese voice so that you won't have to manually insert the <voice> tags.
  • Save cost. Inserted audio files and <break> will be handled locally in your browser. Previously generated speeches will be reused whenever possible after minor edit to the text.
  • Export the speech to WAV files.
  • Side effects: You can use it as a simple audio joiner, or even an audio-to-wav converter.

How to use

  1. Clone this repo. Place it somewhere that can run PHP and reach Google. NOTE FOR USERS IN MAINLAND CHINA / 中国大陆用户请注意:本项目使用了Google服务,请确保您运行PHP的服务器可以访问Google。
  2. Follow Google's guide to Step 4 and obtain your key file.
  3. Place your key file on your server. Edit config.php and replace /path/to/your/key.json with the path to your key file.
  4. Follow Google's guide to install Google Cloud's client library for PHP for text-to-speech. Be sure to run the composer command in the directory where you place this repo. Furthermore, this client library for PHP requires the extension ext-bcmath, be sure to have it installed.
  5. Enjoy!

This project uses Google Cloud Services, jQuery, audiobuffer-to-wav.js, Bootstrap.

About

A text reader that uses Google Cloud Text-to-speech Wavenet voices to synthesize

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published