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
- 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
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"
}