Skip to content

REST API to creating TTS / text to speech / synthesis speech / Voice Over

Notifications You must be signed in to change notification settings

randhipp/google-tts-vo-rest-api

Repository files navigation

WAFVEL VOICEOVER


REST API to creating TTS / text to speech / synthesis speech / Voice Over

This NodeJS App will convert your text to audio/mp3 and upload it to google cloud storage. ( you must create new public bucket )

Created using Google Text To Speech API and Fastify

How To Run

  • Clone this repo, set you .env
  • yarn / npm
  • copy your google credentials to root folder beside package.json ./credentials.json
  • yarn start / npm start
  • if you set DEBUG=ON in .env

API Docs

POST : http://localhost:3000/tts

Request

{
    "text":"hello, how are you?",
    "gender":"female",
    "language":"id-ID", // https://cloud.google.com/text-to-speech/docs/voices
    "format":"MP3" // or WAV
}

Response

{
  "url": "https://storage.googleapis.com/<bucket-name>/1623081231612.mp3"
}

Audio Sample

mp3

About

REST API to creating TTS / text to speech / synthesis speech / Voice Over

Topics

Resources

Stars

Watchers

Forks