simple-gtts
Simple Google text to speech
await gTTS("hello there", {
lang: "en-us",
path: "./hello.mp3"
})
Install
$ npm i simple-gtts
Usage
import {gTTS} from "simple-gtts"
gTTS(text, data)
gTTS turns text into speech, and can output either a file or a buffer
file
await gTTS("hello there", {
path: "./hello.mp3"
})
buffer
const buff = await gTTS("hello there")
languages
You can change the language the text is read in by providing a language code
await gTTS("hello there", {
lang: "fr",
path: "./hello.mp3"
})
To view the available languages, you can import and console.log them
import {languages} from "simple-gtts"
console.log(languages)