New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-google-tts-api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-google-tts-api

Simple node.js library for google text to speech

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
decreased by-40.74%
Maintainers
1
Weekly downloads
 
Created
Source

node-google-tts-api

Simple node.js library for google text to speech service

Installation

npm i node-google-tts-api 

Usage

const googleTTS = require('node-google-tts-api');
const tts = new googleTTS();

const fs = require('fs');

tts.get({
  text: "hello world",
  lang: "en"
}).then(data => {
  // returns mp3 audio src buffer
  fs.writeFileSync("./audio.mp3", data);
});

Text length limit

Google forbids sending text over 200 characters - which is not very cool. Therefore, a bypass was made:

tts.get({
  text: "a".repeat(200) + "b".repeat(50),
  lang: "en",
  limit_bypass: true // required parameter
}).then(arr => {
  // returns array with mp3 audio src buffers
  let data = tts.concat(arr); // concat audio files
  fs.writeFileSync("./audio.mp3", data);
});

Supported languages

Google text to speech service supports the following language codes:
https://github.com/IldarSham/node-google-tts/blob/master/supported-languages.txt

Keywords

FAQs

Package last updated on 12 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc