An open API service indexing awesome lists of open source software.

https://github.com/hubendubler/gtts.js

A Promise based Node.js/TypeScript port of the gTTS Google-Text-To-Speech python library
https://github.com/hubendubler/gtts.js

gtts node-module nodejs speech text-to-speech tts typescript

Last synced: about 1 year ago
JSON representation

A Promise based Node.js/TypeScript port of the gTTS Google-Text-To-Speech python library

Awesome Lists containing this project

README

          

# gTTS.js

[![Build Status](https://travis-ci.com/hubendubler/gTTS.js.svg?branch=master)](https://travis-ci.com/hubendubler/gTTS.js) [![npm version](https://badge.fury.io/js/gtts.js.svg)](https://badge.fury.io/js/gtts.js)

This is a Promise based Node.js/TypeScript port of the [python gTTS Google Text-To-Speech library](https://github.com/pndurette/gTTS).

## Install

`npm install gtts.js`

## How to use

Note: The CLI is currently not supported.

```js
const gTTS = require("gtts.js").gTTS;
const tts = new gTTS("Hello");
tts.save("hello.mp3")
.then(() => {
// Save successful
})
.catch((err) => {
// Process failed
});
```

### TypeScript

```ts
import { gTTS } from "gtts.js";
```