Воскресенье, 14 июня 2020 12:07

Deploying Google-Cloud-TTS-Rails with Heroku

Оцените материал
(0 голосов)

Deploying Google-Cloud-TTS-Rails with Heroku.

 

 

Google Cloud Text-to-Speech on Rails supports Select TEXT or SSML, Speech Rate Modification, and three conversion formats:

  1. MP3 (MPEG Audio Layer III)
  2. WAV (LINEAR16)
  3. OGG (OGG_OPUS).

Languages Google Cloud Text-to-Speech Rails supports:

  • Arabic (multi-region)
  • Català (Espanya)
  • Dansk (Danmark)
  • Deutsch (Deutschland)
  • English (Australia)
  • English (Great Britain)
  • English (India)
  • English (United States)
  • Español (España)
  • Español (US)
  • Français (Canada)
  • Français (France)
  • Italiano (Italia)
  • Japanese (Japan)
  • Latviešu (latviešu)
  • Magyar (Magyarország)
  • Nederlands (Nederland)
  • Norsk bokmål (Norge)
  • Polski (Polska)
  • Português (Brasil)
  • Português (Portugal)
  • Română (România)
  • Suomi (Suomi)
  • Íslenska (Ísland)
  • Čeština (Česká republika)
  • Ελληνικά (Ελλάδα)
  • Български (България)
  • Русский (Россия)
  • Українська (Україна)
  • हिन्दी (भारत)

 

Google-Cloud-TTS-Rails
Google-Cloud-TTS-Rails
Google-Cloud-TTS-Rails
Google-Cloud-TTS-Rails
Google-Cloud-TTS-Rails
Google-Cloud-TTS-Rails
Google-Cloud-TTS-Rails
Google-Cloud-TTS-Rails
Google-Cloud-TTS-Rails
Google-Cloud-TTS-Rails
Google-Cloud-TTS-Rails
Google-Cloud-TTS-Rails

 

Extended version Google Cloud Text to Speech Rails (Ruby on Rails 6, Webpacker, Bootstrap 5, Ajax Flash Messages) allows some improvements: set the title of the sound file, upload and store audio files to Amazon S3, Google Cloud Storage or Microsoft Azure Storage, translate (API Google Translate) text on the fly.

 

Dev banner 2

 

In order to deploy to Heroku, you need to have an account with them. If you haven't, click here to sign up. Before you can deploy to Heroku, Git and Heroku toolbelt should have already installed.

Now you need to get a JSON file that contains your key to access API Google Cloud Text-to-Speech.
Follow these instructions.

Then:

git clone https://github.com/cmirnow/Google-Cloud-TTS-Rails.git
cd Google-Cloud-TTS-Rails

or

git clone https://github.com/cmirnow/Google-Cloud-Text-to-Speech-Pro.git
cd Google-Cloud-Text-to-Speech-Pro

 

Ok, put YOUR_KEY_NAME.json (Google JSON credentials) into the root of the directory Google-Cloud-TTS-Rails now. Be careful, the service account key for Pro version must contain access to Google Cloud Translate API and Google Cloud Text to Speech API.

Next:

git add .   
git commit -m "my first commit"
heroku create
git push heroku master
heroku run rake db:migrate

 

Attention! If you get an error Command "webpack" not found - read this forum message.

 

Go to Heroku.com administration panel, YOUR_NEW_APPLICATION -> 'Settings' -> 'Reveal Config Vars' and add a new key/value lines:

key: GOOGLE_APPLICATION_CREDENTIALS
value: YOUR_KEY_NAME.json

key: DOMAIN_NAME
value: YOUR_HEROKU_DOMAIN ### i.e 'https://***************.herokuapp.com' without quotes.

key: GMAIL_USER_NAME
value: YOUR_GMAIL_LOGIN

key: GMAIL_PASSWORD
value: YOUR_GMAIL_PASSWORD ### (An App Password is a 16-digit passcode that gives an app or device restricted access to your Google Account without having to divulge your personal password and complete access to your Google Account).

 

Pro version Text to Speech onRails requires these environment variables:

 

DOMAIN_NAME: '****************'
#Gmail
GMAIL_USER_NAME: '**************'
GMAIL_PASSWORD: '***************'
# AWS
AWS_ACCESS_KEY_ID: '******************'
AWS_SECRET_ACCESS_KEY: '******************'
REGION: "us-east-2" #for example
BUCKET: "your_project_name"
# Use Google Cloud Translate API across RapidAPI (REST):
# RAPIDAPI_KEY: '**************************'
# or directly:
CLOUD_PROJECT_ID: '*******************'
GOOGLE_APPLICATION_CREDENTIALS: "key.json"

Everything working? Great. Now open your new application in a browser and click 'Sign Up'. Register and you can start converting text to sound.


 

Paid support service

This article contains a comprehensive list of steps required to deploy Google-Cloud-TTS-Rails to Heroku. However, if you fail, I can do it for you.

The cost of the service is 5€. Please transfer this amount to me, also send:

  • Access to your Heroku account.
  • JSON file that contains your key to access API Google Cloud Text-to-Speech.
  • Your email.

Thank you for your interest!
Yours truly,
Aleksei

Deploying Google-Cloud-TTS-Rails with Heroku. Paid support service 

Последнее изменениеСуббота, 22 июня 2024 22:31

Оставить комментарий

Добавьте ваш комментарий

Poker onRails

Text To Speech

Комментарии в блоге

  • Aleksej Yes. You can see it, I switched the temperature from C to F in the module on this page (Costa… 2024-10-01 21:43:42
    jWeather by ip. Погода по ip для Joomla!
  • Anne Is it possible to change temperature to F vs C? 2024-10-01 18:55:58
    jWeather by ip. Погода по ip для Joomla!
  • Aleksej Первое, что бросается в глаза: период времени, прошедший между тем, как автор комментария разбросал аналогичный текст по нескольким интернет-площадкам рунета,… 2024-07-02 14:10:05
    Tobeamerica эмансипе
  • Валерий Л. Предыдущий отзыв неактуален. Это было недоразумение, мы его уладили. Компания вернула мне деньги, никаких претензий к ней я не имею.… 2024-07-01 17:10:43
    Tobeamerica эмансипе
  • Евгения Кличко Спасибо. 2024-06-25 01:03:32
    Joomla cache. Problems and solutions

Заказать сайт

Веб-разработка. Заказать сайт

Вы можете заказать сайт-визитку, блог, корпоративный сайт, интернет-магазин или коммерческий web-портал.